diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95f17d4..9bc098c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,6 +75,7 @@ + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95f17d4..9bc098c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,6 +75,7 @@ + diff --git a/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java new file mode 100644 index 0000000..4f51e23 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java @@ -0,0 +1,724 @@ +package com.casic.xz.meterage.model; + +import java.util.List; + +public class RemindEquipmentListModel { + + private int code; + private DataModel data; + private String message; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataModel getData() { + return data; + } + + public void setData(DataModel data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static class DataModel { + private List rows; + private int total; + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public static class RowsModel { + private String abc; + private String abcName; + private String applyRelationId; + private String assetNo; + private String assetSource; + private String assetType; + private String assetTypeName; + private String attribute; + private String capitalSource; + private String capitalSourceName; + private String cardEstablishmentDate; + private String compulsoryVerification; + private String createTime; + private String createUser; + private String depreciationMethod; + private String depreciationMethodName; + private String depreciationPeriod; + private String enableDate; + private String equipmentCategory; + private String equipmentCategoryName; + private String equipmentName; + private String equipmentNo; + private String equipmentSpecifications; + private String equipmentType; + private String equipmentTypeName; + private String fileList; + private String id; + private String installIncidentalExpenses; + private String installPlace; + private String intactState; + private String isCalibrationTestEquipment; + private String isDel; + private String isFixedAssets; + private String isMeasureAccount; + private String isStandardSupportEquipment; + private String labelBind; + private String majorCategory; + private String majorCategoryName; + private String managerLevel; + private String managerLevelName; + private String managerState; + private String managerStateName; + private String manufacturer; + private String manufacturerCountry; + private String manufacturingDate; + private String manufacturingNo; + private String mesureCycle; + private String mesureDate; + private String mesureDept; + private String mesureDeptName; + private String mesureRange; + private String mesureResult; + private String mesureResultName; + private String mesureType; + private String mesureTypeName; + private String modelNo; + private String originValue; + private String overallDimension; + private String presentOriginValue; + private String purpose; + private String remark; + private String singlePrice; + private String supportStandardEquipmentName; + private String supportStandardEquipmentNo; + private String technicalLevel; + private String uncertainty; + private String updateTime; + private String useDept; + private String useDeptName; + private String usePerson; + private String usePersonName; + private String validDate; + private String version; + private String weight; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public String getAbcName() { + return abcName; + } + + public void setAbcName(String abcName) { + this.abcName = abcName; + } + + public String getApplyRelationId() { + return applyRelationId; + } + + public void setApplyRelationId(String applyRelationId) { + this.applyRelationId = applyRelationId; + } + + public String getAssetNo() { + return assetNo; + } + + public void setAssetNo(String assetNo) { + this.assetNo = assetNo; + } + + public String getAssetSource() { + return assetSource; + } + + public void setAssetSource(String assetSource) { + this.assetSource = assetSource; + } + + public String getAssetType() { + return assetType; + } + + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + public String getAssetTypeName() { + return assetTypeName; + } + + public void setAssetTypeName(String assetTypeName) { + this.assetTypeName = assetTypeName; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getCapitalSource() { + return capitalSource; + } + + public void setCapitalSource(String capitalSource) { + this.capitalSource = capitalSource; + } + + public String getCapitalSourceName() { + return capitalSourceName; + } + + public void setCapitalSourceName(String capitalSourceName) { + this.capitalSourceName = capitalSourceName; + } + + public String getCardEstablishmentDate() { + return cardEstablishmentDate; + } + + public void setCardEstablishmentDate(String cardEstablishmentDate) { + this.cardEstablishmentDate = cardEstablishmentDate; + } + + public String getCompulsoryVerification() { + return compulsoryVerification; + } + + public void setCompulsoryVerification(String compulsoryVerification) { + this.compulsoryVerification = compulsoryVerification; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getDepreciationMethod() { + return depreciationMethod; + } + + public void setDepreciationMethod(String depreciationMethod) { + this.depreciationMethod = depreciationMethod; + } + + public String getDepreciationMethodName() { + return depreciationMethodName; + } + + public void setDepreciationMethodName(String depreciationMethodName) { + this.depreciationMethodName = depreciationMethodName; + } + + public String getDepreciationPeriod() { + return depreciationPeriod; + } + + public void setDepreciationPeriod(String depreciationPeriod) { + this.depreciationPeriod = depreciationPeriod; + } + + public String getEnableDate() { + return enableDate; + } + + public void setEnableDate(String enableDate) { + this.enableDate = enableDate; + } + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + + public String getEquipmentCategoryName() { + return equipmentCategoryName; + } + + public void setEquipmentCategoryName(String equipmentCategoryName) { + this.equipmentCategoryName = equipmentCategoryName; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentNo() { + return equipmentNo; + } + + public void setEquipmentNo(String equipmentNo) { + this.equipmentNo = equipmentNo; + } + + public String getEquipmentSpecifications() { + return equipmentSpecifications; + } + + public void setEquipmentSpecifications(String equipmentSpecifications) { + this.equipmentSpecifications = equipmentSpecifications; + } + + public String getEquipmentType() { + return equipmentType; + } + + public void setEquipmentType(String equipmentType) { + this.equipmentType = equipmentType; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getFileList() { + return fileList; + } + + public void setFileList(String fileList) { + this.fileList = fileList; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInstallIncidentalExpenses() { + return installIncidentalExpenses; + } + + public void setInstallIncidentalExpenses(String installIncidentalExpenses) { + this.installIncidentalExpenses = installIncidentalExpenses; + } + + public String getInstallPlace() { + return installPlace; + } + + public void setInstallPlace(String installPlace) { + this.installPlace = installPlace; + } + + public String getIntactState() { + return intactState; + } + + public void setIntactState(String intactState) { + this.intactState = intactState; + } + + public String getIsCalibrationTestEquipment() { + return isCalibrationTestEquipment; + } + + public void setIsCalibrationTestEquipment(String isCalibrationTestEquipment) { + this.isCalibrationTestEquipment = isCalibrationTestEquipment; + } + + public String getIsDel() { + return isDel; + } + + public void setIsDel(String isDel) { + this.isDel = isDel; + } + + public String getIsFixedAssets() { + return isFixedAssets; + } + + public void setIsFixedAssets(String isFixedAssets) { + this.isFixedAssets = isFixedAssets; + } + + public String getIsMeasureAccount() { + return isMeasureAccount; + } + + public void setIsMeasureAccount(String isMeasureAccount) { + this.isMeasureAccount = isMeasureAccount; + } + + public String getIsStandardSupportEquipment() { + return isStandardSupportEquipment; + } + + public void setIsStandardSupportEquipment(String isStandardSupportEquipment) { + this.isStandardSupportEquipment = isStandardSupportEquipment; + } + + public String getLabelBind() { + return labelBind; + } + + public void setLabelBind(String labelBind) { + this.labelBind = labelBind; + } + + public String getMajorCategory() { + return majorCategory; + } + + public void setMajorCategory(String majorCategory) { + this.majorCategory = majorCategory; + } + + public String getMajorCategoryName() { + return majorCategoryName; + } + + public void setMajorCategoryName(String majorCategoryName) { + this.majorCategoryName = majorCategoryName; + } + + public String getManagerLevel() { + return managerLevel; + } + + public void setManagerLevel(String managerLevel) { + this.managerLevel = managerLevel; + } + + public String getManagerLevelName() { + return managerLevelName; + } + + public void setManagerLevelName(String managerLevelName) { + this.managerLevelName = managerLevelName; + } + + public String getManagerState() { + return managerState; + } + + public void setManagerState(String managerState) { + this.managerState = managerState; + } + + public String getManagerStateName() { + return managerStateName; + } + + public void setManagerStateName(String managerStateName) { + this.managerStateName = managerStateName; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturerCountry() { + return manufacturerCountry; + } + + public void setManufacturerCountry(String manufacturerCountry) { + this.manufacturerCountry = manufacturerCountry; + } + + public String getManufacturingDate() { + return manufacturingDate; + } + + public void setManufacturingDate(String manufacturingDate) { + this.manufacturingDate = manufacturingDate; + } + + public String getManufacturingNo() { + return manufacturingNo; + } + + public void setManufacturingNo(String manufacturingNo) { + this.manufacturingNo = manufacturingNo; + } + + public String getMesureCycle() { + return mesureCycle; + } + + public void setMesureCycle(String mesureCycle) { + this.mesureCycle = mesureCycle; + } + + public String getMesureDate() { + return mesureDate; + } + + public void setMesureDate(String mesureDate) { + this.mesureDate = mesureDate; + } + + public String getMesureDept() { + return mesureDept; + } + + public void setMesureDept(String mesureDept) { + this.mesureDept = mesureDept; + } + + public String getMesureDeptName() { + return mesureDeptName; + } + + public void setMesureDeptName(String mesureDeptName) { + this.mesureDeptName = mesureDeptName; + } + + public String getMesureRange() { + return mesureRange; + } + + public void setMesureRange(String mesureRange) { + this.mesureRange = mesureRange; + } + + public String getMesureResult() { + return mesureResult; + } + + public void setMesureResult(String mesureResult) { + this.mesureResult = mesureResult; + } + + public String getMesureResultName() { + return mesureResultName; + } + + public void setMesureResultName(String mesureResultName) { + this.mesureResultName = mesureResultName; + } + + public String getMesureType() { + return mesureType; + } + + public void setMesureType(String mesureType) { + this.mesureType = mesureType; + } + + public String getMesureTypeName() { + return mesureTypeName; + } + + public void setMesureTypeName(String mesureTypeName) { + this.mesureTypeName = mesureTypeName; + } + + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getOriginValue() { + return originValue; + } + + public void setOriginValue(String originValue) { + this.originValue = originValue; + } + + public String getOverallDimension() { + return overallDimension; + } + + public void setOverallDimension(String overallDimension) { + this.overallDimension = overallDimension; + } + + public String getPresentOriginValue() { + return presentOriginValue; + } + + public void setPresentOriginValue(String presentOriginValue) { + this.presentOriginValue = presentOriginValue; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getSinglePrice() { + return singlePrice; + } + + public void setSinglePrice(String singlePrice) { + this.singlePrice = singlePrice; + } + + public String getSupportStandardEquipmentName() { + return supportStandardEquipmentName; + } + + public void setSupportStandardEquipmentName(String supportStandardEquipmentName) { + this.supportStandardEquipmentName = supportStandardEquipmentName; + } + + public String getSupportStandardEquipmentNo() { + return supportStandardEquipmentNo; + } + + public void setSupportStandardEquipmentNo(String supportStandardEquipmentNo) { + this.supportStandardEquipmentNo = supportStandardEquipmentNo; + } + + public String getTechnicalLevel() { + return technicalLevel; + } + + public void setTechnicalLevel(String technicalLevel) { + this.technicalLevel = technicalLevel; + } + + public String getUncertainty() { + return uncertainty; + } + + public void setUncertainty(String uncertainty) { + this.uncertainty = uncertainty; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getUseDept() { + return useDept; + } + + public void setUseDept(String useDept) { + this.useDept = useDept; + } + + public String getUseDeptName() { + return useDeptName; + } + + public void setUseDeptName(String useDeptName) { + this.useDeptName = useDeptName; + } + + public String getUsePerson() { + return usePerson; + } + + public void setUsePerson(String usePerson) { + this.usePerson = usePerson; + } + + public String getUsePersonName() { + return usePersonName; + } + + public void setUsePersonName(String usePersonName) { + this.usePersonName = usePersonName; + } + + public String getValidDate() { + return validDate; + } + + public void setValidDate(String validDate) { + this.validDate = validDate; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getWeight() { + return weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } + } + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95f17d4..9bc098c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,6 +75,7 @@ + diff --git a/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java new file mode 100644 index 0000000..4f51e23 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java @@ -0,0 +1,724 @@ +package com.casic.xz.meterage.model; + +import java.util.List; + +public class RemindEquipmentListModel { + + private int code; + private DataModel data; + private String message; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataModel getData() { + return data; + } + + public void setData(DataModel data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static class DataModel { + private List rows; + private int total; + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public static class RowsModel { + private String abc; + private String abcName; + private String applyRelationId; + private String assetNo; + private String assetSource; + private String assetType; + private String assetTypeName; + private String attribute; + private String capitalSource; + private String capitalSourceName; + private String cardEstablishmentDate; + private String compulsoryVerification; + private String createTime; + private String createUser; + private String depreciationMethod; + private String depreciationMethodName; + private String depreciationPeriod; + private String enableDate; + private String equipmentCategory; + private String equipmentCategoryName; + private String equipmentName; + private String equipmentNo; + private String equipmentSpecifications; + private String equipmentType; + private String equipmentTypeName; + private String fileList; + private String id; + private String installIncidentalExpenses; + private String installPlace; + private String intactState; + private String isCalibrationTestEquipment; + private String isDel; + private String isFixedAssets; + private String isMeasureAccount; + private String isStandardSupportEquipment; + private String labelBind; + private String majorCategory; + private String majorCategoryName; + private String managerLevel; + private String managerLevelName; + private String managerState; + private String managerStateName; + private String manufacturer; + private String manufacturerCountry; + private String manufacturingDate; + private String manufacturingNo; + private String mesureCycle; + private String mesureDate; + private String mesureDept; + private String mesureDeptName; + private String mesureRange; + private String mesureResult; + private String mesureResultName; + private String mesureType; + private String mesureTypeName; + private String modelNo; + private String originValue; + private String overallDimension; + private String presentOriginValue; + private String purpose; + private String remark; + private String singlePrice; + private String supportStandardEquipmentName; + private String supportStandardEquipmentNo; + private String technicalLevel; + private String uncertainty; + private String updateTime; + private String useDept; + private String useDeptName; + private String usePerson; + private String usePersonName; + private String validDate; + private String version; + private String weight; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public String getAbcName() { + return abcName; + } + + public void setAbcName(String abcName) { + this.abcName = abcName; + } + + public String getApplyRelationId() { + return applyRelationId; + } + + public void setApplyRelationId(String applyRelationId) { + this.applyRelationId = applyRelationId; + } + + public String getAssetNo() { + return assetNo; + } + + public void setAssetNo(String assetNo) { + this.assetNo = assetNo; + } + + public String getAssetSource() { + return assetSource; + } + + public void setAssetSource(String assetSource) { + this.assetSource = assetSource; + } + + public String getAssetType() { + return assetType; + } + + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + public String getAssetTypeName() { + return assetTypeName; + } + + public void setAssetTypeName(String assetTypeName) { + this.assetTypeName = assetTypeName; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getCapitalSource() { + return capitalSource; + } + + public void setCapitalSource(String capitalSource) { + this.capitalSource = capitalSource; + } + + public String getCapitalSourceName() { + return capitalSourceName; + } + + public void setCapitalSourceName(String capitalSourceName) { + this.capitalSourceName = capitalSourceName; + } + + public String getCardEstablishmentDate() { + return cardEstablishmentDate; + } + + public void setCardEstablishmentDate(String cardEstablishmentDate) { + this.cardEstablishmentDate = cardEstablishmentDate; + } + + public String getCompulsoryVerification() { + return compulsoryVerification; + } + + public void setCompulsoryVerification(String compulsoryVerification) { + this.compulsoryVerification = compulsoryVerification; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getDepreciationMethod() { + return depreciationMethod; + } + + public void setDepreciationMethod(String depreciationMethod) { + this.depreciationMethod = depreciationMethod; + } + + public String getDepreciationMethodName() { + return depreciationMethodName; + } + + public void setDepreciationMethodName(String depreciationMethodName) { + this.depreciationMethodName = depreciationMethodName; + } + + public String getDepreciationPeriod() { + return depreciationPeriod; + } + + public void setDepreciationPeriod(String depreciationPeriod) { + this.depreciationPeriod = depreciationPeriod; + } + + public String getEnableDate() { + return enableDate; + } + + public void setEnableDate(String enableDate) { + this.enableDate = enableDate; + } + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + + public String getEquipmentCategoryName() { + return equipmentCategoryName; + } + + public void setEquipmentCategoryName(String equipmentCategoryName) { + this.equipmentCategoryName = equipmentCategoryName; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentNo() { + return equipmentNo; + } + + public void setEquipmentNo(String equipmentNo) { + this.equipmentNo = equipmentNo; + } + + public String getEquipmentSpecifications() { + return equipmentSpecifications; + } + + public void setEquipmentSpecifications(String equipmentSpecifications) { + this.equipmentSpecifications = equipmentSpecifications; + } + + public String getEquipmentType() { + return equipmentType; + } + + public void setEquipmentType(String equipmentType) { + this.equipmentType = equipmentType; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getFileList() { + return fileList; + } + + public void setFileList(String fileList) { + this.fileList = fileList; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInstallIncidentalExpenses() { + return installIncidentalExpenses; + } + + public void setInstallIncidentalExpenses(String installIncidentalExpenses) { + this.installIncidentalExpenses = installIncidentalExpenses; + } + + public String getInstallPlace() { + return installPlace; + } + + public void setInstallPlace(String installPlace) { + this.installPlace = installPlace; + } + + public String getIntactState() { + return intactState; + } + + public void setIntactState(String intactState) { + this.intactState = intactState; + } + + public String getIsCalibrationTestEquipment() { + return isCalibrationTestEquipment; + } + + public void setIsCalibrationTestEquipment(String isCalibrationTestEquipment) { + this.isCalibrationTestEquipment = isCalibrationTestEquipment; + } + + public String getIsDel() { + return isDel; + } + + public void setIsDel(String isDel) { + this.isDel = isDel; + } + + public String getIsFixedAssets() { + return isFixedAssets; + } + + public void setIsFixedAssets(String isFixedAssets) { + this.isFixedAssets = isFixedAssets; + } + + public String getIsMeasureAccount() { + return isMeasureAccount; + } + + public void setIsMeasureAccount(String isMeasureAccount) { + this.isMeasureAccount = isMeasureAccount; + } + + public String getIsStandardSupportEquipment() { + return isStandardSupportEquipment; + } + + public void setIsStandardSupportEquipment(String isStandardSupportEquipment) { + this.isStandardSupportEquipment = isStandardSupportEquipment; + } + + public String getLabelBind() { + return labelBind; + } + + public void setLabelBind(String labelBind) { + this.labelBind = labelBind; + } + + public String getMajorCategory() { + return majorCategory; + } + + public void setMajorCategory(String majorCategory) { + this.majorCategory = majorCategory; + } + + public String getMajorCategoryName() { + return majorCategoryName; + } + + public void setMajorCategoryName(String majorCategoryName) { + this.majorCategoryName = majorCategoryName; + } + + public String getManagerLevel() { + return managerLevel; + } + + public void setManagerLevel(String managerLevel) { + this.managerLevel = managerLevel; + } + + public String getManagerLevelName() { + return managerLevelName; + } + + public void setManagerLevelName(String managerLevelName) { + this.managerLevelName = managerLevelName; + } + + public String getManagerState() { + return managerState; + } + + public void setManagerState(String managerState) { + this.managerState = managerState; + } + + public String getManagerStateName() { + return managerStateName; + } + + public void setManagerStateName(String managerStateName) { + this.managerStateName = managerStateName; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturerCountry() { + return manufacturerCountry; + } + + public void setManufacturerCountry(String manufacturerCountry) { + this.manufacturerCountry = manufacturerCountry; + } + + public String getManufacturingDate() { + return manufacturingDate; + } + + public void setManufacturingDate(String manufacturingDate) { + this.manufacturingDate = manufacturingDate; + } + + public String getManufacturingNo() { + return manufacturingNo; + } + + public void setManufacturingNo(String manufacturingNo) { + this.manufacturingNo = manufacturingNo; + } + + public String getMesureCycle() { + return mesureCycle; + } + + public void setMesureCycle(String mesureCycle) { + this.mesureCycle = mesureCycle; + } + + public String getMesureDate() { + return mesureDate; + } + + public void setMesureDate(String mesureDate) { + this.mesureDate = mesureDate; + } + + public String getMesureDept() { + return mesureDept; + } + + public void setMesureDept(String mesureDept) { + this.mesureDept = mesureDept; + } + + public String getMesureDeptName() { + return mesureDeptName; + } + + public void setMesureDeptName(String mesureDeptName) { + this.mesureDeptName = mesureDeptName; + } + + public String getMesureRange() { + return mesureRange; + } + + public void setMesureRange(String mesureRange) { + this.mesureRange = mesureRange; + } + + public String getMesureResult() { + return mesureResult; + } + + public void setMesureResult(String mesureResult) { + this.mesureResult = mesureResult; + } + + public String getMesureResultName() { + return mesureResultName; + } + + public void setMesureResultName(String mesureResultName) { + this.mesureResultName = mesureResultName; + } + + public String getMesureType() { + return mesureType; + } + + public void setMesureType(String mesureType) { + this.mesureType = mesureType; + } + + public String getMesureTypeName() { + return mesureTypeName; + } + + public void setMesureTypeName(String mesureTypeName) { + this.mesureTypeName = mesureTypeName; + } + + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getOriginValue() { + return originValue; + } + + public void setOriginValue(String originValue) { + this.originValue = originValue; + } + + public String getOverallDimension() { + return overallDimension; + } + + public void setOverallDimension(String overallDimension) { + this.overallDimension = overallDimension; + } + + public String getPresentOriginValue() { + return presentOriginValue; + } + + public void setPresentOriginValue(String presentOriginValue) { + this.presentOriginValue = presentOriginValue; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getSinglePrice() { + return singlePrice; + } + + public void setSinglePrice(String singlePrice) { + this.singlePrice = singlePrice; + } + + public String getSupportStandardEquipmentName() { + return supportStandardEquipmentName; + } + + public void setSupportStandardEquipmentName(String supportStandardEquipmentName) { + this.supportStandardEquipmentName = supportStandardEquipmentName; + } + + public String getSupportStandardEquipmentNo() { + return supportStandardEquipmentNo; + } + + public void setSupportStandardEquipmentNo(String supportStandardEquipmentNo) { + this.supportStandardEquipmentNo = supportStandardEquipmentNo; + } + + public String getTechnicalLevel() { + return technicalLevel; + } + + public void setTechnicalLevel(String technicalLevel) { + this.technicalLevel = technicalLevel; + } + + public String getUncertainty() { + return uncertainty; + } + + public void setUncertainty(String uncertainty) { + this.uncertainty = uncertainty; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getUseDept() { + return useDept; + } + + public void setUseDept(String useDept) { + this.useDept = useDept; + } + + public String getUseDeptName() { + return useDeptName; + } + + public void setUseDeptName(String useDeptName) { + this.useDeptName = useDeptName; + } + + public String getUsePerson() { + return usePerson; + } + + public void setUsePerson(String usePerson) { + this.usePerson = usePerson; + } + + public String getUsePersonName() { + return usePersonName; + } + + public void setUsePersonName(String usePersonName) { + this.usePersonName = usePersonName; + } + + public String getValidDate() { + return validDate; + } + + public void setValidDate(String validDate) { + this.validDate = validDate; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getWeight() { + return weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } + } + } +} diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt index c4eb16d..cb371ab 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt @@ -282,6 +282,26 @@ suspend fun getRemindEquipmentCount(@Header("token") token: String): String /** + * 获取到期设备列表 + */ + @POST("/meter/assets/remindListPage") + suspend fun getRemindEquipmentList( + @Header("token") token: String, + @Body requestBody: RequestBody, + @QueryMap limit: Map, + @QueryMap offset: Map + ): String + + /** + * 催办设备 + */ + @POST("/meter/assets/remindWorker") + suspend fun remindEquipment( + @Header("token") token: String, + @Body requestBody: RequestBody + ): String + + /** * 获取到期仪器数 */ @GET("/meter/standard/remindQuantity") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95f17d4..9bc098c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,6 +75,7 @@ + diff --git a/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java new file mode 100644 index 0000000..4f51e23 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java @@ -0,0 +1,724 @@ +package com.casic.xz.meterage.model; + +import java.util.List; + +public class RemindEquipmentListModel { + + private int code; + private DataModel data; + private String message; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataModel getData() { + return data; + } + + public void setData(DataModel data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static class DataModel { + private List rows; + private int total; + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public static class RowsModel { + private String abc; + private String abcName; + private String applyRelationId; + private String assetNo; + private String assetSource; + private String assetType; + private String assetTypeName; + private String attribute; + private String capitalSource; + private String capitalSourceName; + private String cardEstablishmentDate; + private String compulsoryVerification; + private String createTime; + private String createUser; + private String depreciationMethod; + private String depreciationMethodName; + private String depreciationPeriod; + private String enableDate; + private String equipmentCategory; + private String equipmentCategoryName; + private String equipmentName; + private String equipmentNo; + private String equipmentSpecifications; + private String equipmentType; + private String equipmentTypeName; + private String fileList; + private String id; + private String installIncidentalExpenses; + private String installPlace; + private String intactState; + private String isCalibrationTestEquipment; + private String isDel; + private String isFixedAssets; + private String isMeasureAccount; + private String isStandardSupportEquipment; + private String labelBind; + private String majorCategory; + private String majorCategoryName; + private String managerLevel; + private String managerLevelName; + private String managerState; + private String managerStateName; + private String manufacturer; + private String manufacturerCountry; + private String manufacturingDate; + private String manufacturingNo; + private String mesureCycle; + private String mesureDate; + private String mesureDept; + private String mesureDeptName; + private String mesureRange; + private String mesureResult; + private String mesureResultName; + private String mesureType; + private String mesureTypeName; + private String modelNo; + private String originValue; + private String overallDimension; + private String presentOriginValue; + private String purpose; + private String remark; + private String singlePrice; + private String supportStandardEquipmentName; + private String supportStandardEquipmentNo; + private String technicalLevel; + private String uncertainty; + private String updateTime; + private String useDept; + private String useDeptName; + private String usePerson; + private String usePersonName; + private String validDate; + private String version; + private String weight; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public String getAbcName() { + return abcName; + } + + public void setAbcName(String abcName) { + this.abcName = abcName; + } + + public String getApplyRelationId() { + return applyRelationId; + } + + public void setApplyRelationId(String applyRelationId) { + this.applyRelationId = applyRelationId; + } + + public String getAssetNo() { + return assetNo; + } + + public void setAssetNo(String assetNo) { + this.assetNo = assetNo; + } + + public String getAssetSource() { + return assetSource; + } + + public void setAssetSource(String assetSource) { + this.assetSource = assetSource; + } + + public String getAssetType() { + return assetType; + } + + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + public String getAssetTypeName() { + return assetTypeName; + } + + public void setAssetTypeName(String assetTypeName) { + this.assetTypeName = assetTypeName; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getCapitalSource() { + return capitalSource; + } + + public void setCapitalSource(String capitalSource) { + this.capitalSource = capitalSource; + } + + public String getCapitalSourceName() { + return capitalSourceName; + } + + public void setCapitalSourceName(String capitalSourceName) { + this.capitalSourceName = capitalSourceName; + } + + public String getCardEstablishmentDate() { + return cardEstablishmentDate; + } + + public void setCardEstablishmentDate(String cardEstablishmentDate) { + this.cardEstablishmentDate = cardEstablishmentDate; + } + + public String getCompulsoryVerification() { + return compulsoryVerification; + } + + public void setCompulsoryVerification(String compulsoryVerification) { + this.compulsoryVerification = compulsoryVerification; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getDepreciationMethod() { + return depreciationMethod; + } + + public void setDepreciationMethod(String depreciationMethod) { + this.depreciationMethod = depreciationMethod; + } + + public String getDepreciationMethodName() { + return depreciationMethodName; + } + + public void setDepreciationMethodName(String depreciationMethodName) { + this.depreciationMethodName = depreciationMethodName; + } + + public String getDepreciationPeriod() { + return depreciationPeriod; + } + + public void setDepreciationPeriod(String depreciationPeriod) { + this.depreciationPeriod = depreciationPeriod; + } + + public String getEnableDate() { + return enableDate; + } + + public void setEnableDate(String enableDate) { + this.enableDate = enableDate; + } + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + + public String getEquipmentCategoryName() { + return equipmentCategoryName; + } + + public void setEquipmentCategoryName(String equipmentCategoryName) { + this.equipmentCategoryName = equipmentCategoryName; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentNo() { + return equipmentNo; + } + + public void setEquipmentNo(String equipmentNo) { + this.equipmentNo = equipmentNo; + } + + public String getEquipmentSpecifications() { + return equipmentSpecifications; + } + + public void setEquipmentSpecifications(String equipmentSpecifications) { + this.equipmentSpecifications = equipmentSpecifications; + } + + public String getEquipmentType() { + return equipmentType; + } + + public void setEquipmentType(String equipmentType) { + this.equipmentType = equipmentType; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getFileList() { + return fileList; + } + + public void setFileList(String fileList) { + this.fileList = fileList; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInstallIncidentalExpenses() { + return installIncidentalExpenses; + } + + public void setInstallIncidentalExpenses(String installIncidentalExpenses) { + this.installIncidentalExpenses = installIncidentalExpenses; + } + + public String getInstallPlace() { + return installPlace; + } + + public void setInstallPlace(String installPlace) { + this.installPlace = installPlace; + } + + public String getIntactState() { + return intactState; + } + + public void setIntactState(String intactState) { + this.intactState = intactState; + } + + public String getIsCalibrationTestEquipment() { + return isCalibrationTestEquipment; + } + + public void setIsCalibrationTestEquipment(String isCalibrationTestEquipment) { + this.isCalibrationTestEquipment = isCalibrationTestEquipment; + } + + public String getIsDel() { + return isDel; + } + + public void setIsDel(String isDel) { + this.isDel = isDel; + } + + public String getIsFixedAssets() { + return isFixedAssets; + } + + public void setIsFixedAssets(String isFixedAssets) { + this.isFixedAssets = isFixedAssets; + } + + public String getIsMeasureAccount() { + return isMeasureAccount; + } + + public void setIsMeasureAccount(String isMeasureAccount) { + this.isMeasureAccount = isMeasureAccount; + } + + public String getIsStandardSupportEquipment() { + return isStandardSupportEquipment; + } + + public void setIsStandardSupportEquipment(String isStandardSupportEquipment) { + this.isStandardSupportEquipment = isStandardSupportEquipment; + } + + public String getLabelBind() { + return labelBind; + } + + public void setLabelBind(String labelBind) { + this.labelBind = labelBind; + } + + public String getMajorCategory() { + return majorCategory; + } + + public void setMajorCategory(String majorCategory) { + this.majorCategory = majorCategory; + } + + public String getMajorCategoryName() { + return majorCategoryName; + } + + public void setMajorCategoryName(String majorCategoryName) { + this.majorCategoryName = majorCategoryName; + } + + public String getManagerLevel() { + return managerLevel; + } + + public void setManagerLevel(String managerLevel) { + this.managerLevel = managerLevel; + } + + public String getManagerLevelName() { + return managerLevelName; + } + + public void setManagerLevelName(String managerLevelName) { + this.managerLevelName = managerLevelName; + } + + public String getManagerState() { + return managerState; + } + + public void setManagerState(String managerState) { + this.managerState = managerState; + } + + public String getManagerStateName() { + return managerStateName; + } + + public void setManagerStateName(String managerStateName) { + this.managerStateName = managerStateName; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturerCountry() { + return manufacturerCountry; + } + + public void setManufacturerCountry(String manufacturerCountry) { + this.manufacturerCountry = manufacturerCountry; + } + + public String getManufacturingDate() { + return manufacturingDate; + } + + public void setManufacturingDate(String manufacturingDate) { + this.manufacturingDate = manufacturingDate; + } + + public String getManufacturingNo() { + return manufacturingNo; + } + + public void setManufacturingNo(String manufacturingNo) { + this.manufacturingNo = manufacturingNo; + } + + public String getMesureCycle() { + return mesureCycle; + } + + public void setMesureCycle(String mesureCycle) { + this.mesureCycle = mesureCycle; + } + + public String getMesureDate() { + return mesureDate; + } + + public void setMesureDate(String mesureDate) { + this.mesureDate = mesureDate; + } + + public String getMesureDept() { + return mesureDept; + } + + public void setMesureDept(String mesureDept) { + this.mesureDept = mesureDept; + } + + public String getMesureDeptName() { + return mesureDeptName; + } + + public void setMesureDeptName(String mesureDeptName) { + this.mesureDeptName = mesureDeptName; + } + + public String getMesureRange() { + return mesureRange; + } + + public void setMesureRange(String mesureRange) { + this.mesureRange = mesureRange; + } + + public String getMesureResult() { + return mesureResult; + } + + public void setMesureResult(String mesureResult) { + this.mesureResult = mesureResult; + } + + public String getMesureResultName() { + return mesureResultName; + } + + public void setMesureResultName(String mesureResultName) { + this.mesureResultName = mesureResultName; + } + + public String getMesureType() { + return mesureType; + } + + public void setMesureType(String mesureType) { + this.mesureType = mesureType; + } + + public String getMesureTypeName() { + return mesureTypeName; + } + + public void setMesureTypeName(String mesureTypeName) { + this.mesureTypeName = mesureTypeName; + } + + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getOriginValue() { + return originValue; + } + + public void setOriginValue(String originValue) { + this.originValue = originValue; + } + + public String getOverallDimension() { + return overallDimension; + } + + public void setOverallDimension(String overallDimension) { + this.overallDimension = overallDimension; + } + + public String getPresentOriginValue() { + return presentOriginValue; + } + + public void setPresentOriginValue(String presentOriginValue) { + this.presentOriginValue = presentOriginValue; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getSinglePrice() { + return singlePrice; + } + + public void setSinglePrice(String singlePrice) { + this.singlePrice = singlePrice; + } + + public String getSupportStandardEquipmentName() { + return supportStandardEquipmentName; + } + + public void setSupportStandardEquipmentName(String supportStandardEquipmentName) { + this.supportStandardEquipmentName = supportStandardEquipmentName; + } + + public String getSupportStandardEquipmentNo() { + return supportStandardEquipmentNo; + } + + public void setSupportStandardEquipmentNo(String supportStandardEquipmentNo) { + this.supportStandardEquipmentNo = supportStandardEquipmentNo; + } + + public String getTechnicalLevel() { + return technicalLevel; + } + + public void setTechnicalLevel(String technicalLevel) { + this.technicalLevel = technicalLevel; + } + + public String getUncertainty() { + return uncertainty; + } + + public void setUncertainty(String uncertainty) { + this.uncertainty = uncertainty; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getUseDept() { + return useDept; + } + + public void setUseDept(String useDept) { + this.useDept = useDept; + } + + public String getUseDeptName() { + return useDeptName; + } + + public void setUseDeptName(String useDeptName) { + this.useDeptName = useDeptName; + } + + public String getUsePerson() { + return usePerson; + } + + public void setUsePerson(String usePerson) { + this.usePerson = usePerson; + } + + public String getUsePersonName() { + return usePersonName; + } + + public void setUsePersonName(String usePersonName) { + this.usePersonName = usePersonName; + } + + public String getValidDate() { + return validDate; + } + + public void setValidDate(String validDate) { + this.validDate = validDate; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getWeight() { + return weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } + } + } +} diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt index c4eb16d..cb371ab 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt @@ -282,6 +282,26 @@ suspend fun getRemindEquipmentCount(@Header("token") token: String): String /** + * 获取到期设备列表 + */ + @POST("/meter/assets/remindListPage") + suspend fun getRemindEquipmentList( + @Header("token") token: String, + @Body requestBody: RequestBody, + @QueryMap limit: Map, + @QueryMap offset: Map + ): String + + /** + * 催办设备 + */ + @POST("/meter/assets/remindWorker") + suspend fun remindEquipment( + @Header("token") token: String, + @Body requestBody: RequestBody + ): String + + /** * 获取到期仪器数 */ @GET("/meter/standard/remindQuantity") diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt index 8b385fa..613e881 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt @@ -317,7 +317,6 @@ offset: Int ): String { val param = JsonObject() - param.addProperty("sid", "username") param.addProperty("equipmentNo", equipmentNo) param.addProperty("equipmentName", equipmentName) param.addProperty("mesureType", mesureType) @@ -606,6 +605,84 @@ } /** + * 获取到期设备列表 + */ + suspend fun getRemindEquipmentList( + managerState: String, + abc: String, + mesureType: String, + isCalibrationTestEquipment: String, + equipmentCategory: String, + useDept: String, + equipmentNo: String, + modelNo: String, + assetNo: String, + assetType: String, + isFixedAssets: String, + equipmentSpecifications: String, + labelId: String, + usePerson: String, + ids: Array, + equipmentName: String, + id: String, + validDateStart: String, + isStandardSupportEquipment: String, + isMeasureAccount: String, + manufacturingNo: String, + validDateEnd: String, + offset: Int + ): String { + val param = JsonObject() + param.addProperty("managerState", managerState) + param.addProperty("abc", abc) + param.addProperty("mesureType", mesureType) + param.addProperty("isCalibrationTestEquipment", isCalibrationTestEquipment) + param.addProperty("equipmentCategory", equipmentCategory) + param.addProperty("useDept", useDept) + param.addProperty("equipmentNo", equipmentNo) + param.addProperty("modelNo", modelNo) + param.addProperty("assetNo", assetNo) + param.addProperty("assetType", assetType) + param.addProperty("isFixedAssets", isFixedAssets) + param.addProperty("equipmentSpecifications", equipmentSpecifications) + param.addProperty("labelId", labelId) + param.addProperty("usePerson", usePerson) + param.add("ids", gson.toJsonTree(ids, typeToken).asJsonArray) + param.addProperty("equipmentName", equipmentName) + param.addProperty("id", id) + param.addProperty("validDateStart", validDateStart) + param.addProperty("isStandardSupportEquipment", isStandardSupportEquipment) + param.addProperty("isMeasureAccount", isMeasureAccount) + param.addProperty("manufacturingNo", manufacturingNo) + param.addProperty("validDateEnd", validDateEnd) + + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + + val limitMap = HashMap() + limitMap["limit"] = LocaleConstant.PAGE_LIMIT + + val offsetMap = HashMap() + offsetMap["offset"] = offset + return api.getRemindEquipmentList( + AuthenticationHelper.token!!, requestBody, limitMap, offsetMap + ) + } + + /** + * 催办设备 + */ + suspend fun remindEquipment(id: String): String { + val param = JsonObject() + param.addProperty("id", id) + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + return api.remindEquipment(AuthenticationHelper.token!!, requestBody) + } + + /** * 获取到期仪器数 */ suspend fun getRemindDeviceCount(): String { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95f17d4..9bc098c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,6 +75,7 @@ + diff --git a/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java new file mode 100644 index 0000000..4f51e23 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java @@ -0,0 +1,724 @@ +package com.casic.xz.meterage.model; + +import java.util.List; + +public class RemindEquipmentListModel { + + private int code; + private DataModel data; + private String message; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataModel getData() { + return data; + } + + public void setData(DataModel data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static class DataModel { + private List rows; + private int total; + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public static class RowsModel { + private String abc; + private String abcName; + private String applyRelationId; + private String assetNo; + private String assetSource; + private String assetType; + private String assetTypeName; + private String attribute; + private String capitalSource; + private String capitalSourceName; + private String cardEstablishmentDate; + private String compulsoryVerification; + private String createTime; + private String createUser; + private String depreciationMethod; + private String depreciationMethodName; + private String depreciationPeriod; + private String enableDate; + private String equipmentCategory; + private String equipmentCategoryName; + private String equipmentName; + private String equipmentNo; + private String equipmentSpecifications; + private String equipmentType; + private String equipmentTypeName; + private String fileList; + private String id; + private String installIncidentalExpenses; + private String installPlace; + private String intactState; + private String isCalibrationTestEquipment; + private String isDel; + private String isFixedAssets; + private String isMeasureAccount; + private String isStandardSupportEquipment; + private String labelBind; + private String majorCategory; + private String majorCategoryName; + private String managerLevel; + private String managerLevelName; + private String managerState; + private String managerStateName; + private String manufacturer; + private String manufacturerCountry; + private String manufacturingDate; + private String manufacturingNo; + private String mesureCycle; + private String mesureDate; + private String mesureDept; + private String mesureDeptName; + private String mesureRange; + private String mesureResult; + private String mesureResultName; + private String mesureType; + private String mesureTypeName; + private String modelNo; + private String originValue; + private String overallDimension; + private String presentOriginValue; + private String purpose; + private String remark; + private String singlePrice; + private String supportStandardEquipmentName; + private String supportStandardEquipmentNo; + private String technicalLevel; + private String uncertainty; + private String updateTime; + private String useDept; + private String useDeptName; + private String usePerson; + private String usePersonName; + private String validDate; + private String version; + private String weight; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public String getAbcName() { + return abcName; + } + + public void setAbcName(String abcName) { + this.abcName = abcName; + } + + public String getApplyRelationId() { + return applyRelationId; + } + + public void setApplyRelationId(String applyRelationId) { + this.applyRelationId = applyRelationId; + } + + public String getAssetNo() { + return assetNo; + } + + public void setAssetNo(String assetNo) { + this.assetNo = assetNo; + } + + public String getAssetSource() { + return assetSource; + } + + public void setAssetSource(String assetSource) { + this.assetSource = assetSource; + } + + public String getAssetType() { + return assetType; + } + + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + public String getAssetTypeName() { + return assetTypeName; + } + + public void setAssetTypeName(String assetTypeName) { + this.assetTypeName = assetTypeName; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getCapitalSource() { + return capitalSource; + } + + public void setCapitalSource(String capitalSource) { + this.capitalSource = capitalSource; + } + + public String getCapitalSourceName() { + return capitalSourceName; + } + + public void setCapitalSourceName(String capitalSourceName) { + this.capitalSourceName = capitalSourceName; + } + + public String getCardEstablishmentDate() { + return cardEstablishmentDate; + } + + public void setCardEstablishmentDate(String cardEstablishmentDate) { + this.cardEstablishmentDate = cardEstablishmentDate; + } + + public String getCompulsoryVerification() { + return compulsoryVerification; + } + + public void setCompulsoryVerification(String compulsoryVerification) { + this.compulsoryVerification = compulsoryVerification; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getDepreciationMethod() { + return depreciationMethod; + } + + public void setDepreciationMethod(String depreciationMethod) { + this.depreciationMethod = depreciationMethod; + } + + public String getDepreciationMethodName() { + return depreciationMethodName; + } + + public void setDepreciationMethodName(String depreciationMethodName) { + this.depreciationMethodName = depreciationMethodName; + } + + public String getDepreciationPeriod() { + return depreciationPeriod; + } + + public void setDepreciationPeriod(String depreciationPeriod) { + this.depreciationPeriod = depreciationPeriod; + } + + public String getEnableDate() { + return enableDate; + } + + public void setEnableDate(String enableDate) { + this.enableDate = enableDate; + } + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + + public String getEquipmentCategoryName() { + return equipmentCategoryName; + } + + public void setEquipmentCategoryName(String equipmentCategoryName) { + this.equipmentCategoryName = equipmentCategoryName; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentNo() { + return equipmentNo; + } + + public void setEquipmentNo(String equipmentNo) { + this.equipmentNo = equipmentNo; + } + + public String getEquipmentSpecifications() { + return equipmentSpecifications; + } + + public void setEquipmentSpecifications(String equipmentSpecifications) { + this.equipmentSpecifications = equipmentSpecifications; + } + + public String getEquipmentType() { + return equipmentType; + } + + public void setEquipmentType(String equipmentType) { + this.equipmentType = equipmentType; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getFileList() { + return fileList; + } + + public void setFileList(String fileList) { + this.fileList = fileList; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInstallIncidentalExpenses() { + return installIncidentalExpenses; + } + + public void setInstallIncidentalExpenses(String installIncidentalExpenses) { + this.installIncidentalExpenses = installIncidentalExpenses; + } + + public String getInstallPlace() { + return installPlace; + } + + public void setInstallPlace(String installPlace) { + this.installPlace = installPlace; + } + + public String getIntactState() { + return intactState; + } + + public void setIntactState(String intactState) { + this.intactState = intactState; + } + + public String getIsCalibrationTestEquipment() { + return isCalibrationTestEquipment; + } + + public void setIsCalibrationTestEquipment(String isCalibrationTestEquipment) { + this.isCalibrationTestEquipment = isCalibrationTestEquipment; + } + + public String getIsDel() { + return isDel; + } + + public void setIsDel(String isDel) { + this.isDel = isDel; + } + + public String getIsFixedAssets() { + return isFixedAssets; + } + + public void setIsFixedAssets(String isFixedAssets) { + this.isFixedAssets = isFixedAssets; + } + + public String getIsMeasureAccount() { + return isMeasureAccount; + } + + public void setIsMeasureAccount(String isMeasureAccount) { + this.isMeasureAccount = isMeasureAccount; + } + + public String getIsStandardSupportEquipment() { + return isStandardSupportEquipment; + } + + public void setIsStandardSupportEquipment(String isStandardSupportEquipment) { + this.isStandardSupportEquipment = isStandardSupportEquipment; + } + + public String getLabelBind() { + return labelBind; + } + + public void setLabelBind(String labelBind) { + this.labelBind = labelBind; + } + + public String getMajorCategory() { + return majorCategory; + } + + public void setMajorCategory(String majorCategory) { + this.majorCategory = majorCategory; + } + + public String getMajorCategoryName() { + return majorCategoryName; + } + + public void setMajorCategoryName(String majorCategoryName) { + this.majorCategoryName = majorCategoryName; + } + + public String getManagerLevel() { + return managerLevel; + } + + public void setManagerLevel(String managerLevel) { + this.managerLevel = managerLevel; + } + + public String getManagerLevelName() { + return managerLevelName; + } + + public void setManagerLevelName(String managerLevelName) { + this.managerLevelName = managerLevelName; + } + + public String getManagerState() { + return managerState; + } + + public void setManagerState(String managerState) { + this.managerState = managerState; + } + + public String getManagerStateName() { + return managerStateName; + } + + public void setManagerStateName(String managerStateName) { + this.managerStateName = managerStateName; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturerCountry() { + return manufacturerCountry; + } + + public void setManufacturerCountry(String manufacturerCountry) { + this.manufacturerCountry = manufacturerCountry; + } + + public String getManufacturingDate() { + return manufacturingDate; + } + + public void setManufacturingDate(String manufacturingDate) { + this.manufacturingDate = manufacturingDate; + } + + public String getManufacturingNo() { + return manufacturingNo; + } + + public void setManufacturingNo(String manufacturingNo) { + this.manufacturingNo = manufacturingNo; + } + + public String getMesureCycle() { + return mesureCycle; + } + + public void setMesureCycle(String mesureCycle) { + this.mesureCycle = mesureCycle; + } + + public String getMesureDate() { + return mesureDate; + } + + public void setMesureDate(String mesureDate) { + this.mesureDate = mesureDate; + } + + public String getMesureDept() { + return mesureDept; + } + + public void setMesureDept(String mesureDept) { + this.mesureDept = mesureDept; + } + + public String getMesureDeptName() { + return mesureDeptName; + } + + public void setMesureDeptName(String mesureDeptName) { + this.mesureDeptName = mesureDeptName; + } + + public String getMesureRange() { + return mesureRange; + } + + public void setMesureRange(String mesureRange) { + this.mesureRange = mesureRange; + } + + public String getMesureResult() { + return mesureResult; + } + + public void setMesureResult(String mesureResult) { + this.mesureResult = mesureResult; + } + + public String getMesureResultName() { + return mesureResultName; + } + + public void setMesureResultName(String mesureResultName) { + this.mesureResultName = mesureResultName; + } + + public String getMesureType() { + return mesureType; + } + + public void setMesureType(String mesureType) { + this.mesureType = mesureType; + } + + public String getMesureTypeName() { + return mesureTypeName; + } + + public void setMesureTypeName(String mesureTypeName) { + this.mesureTypeName = mesureTypeName; + } + + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getOriginValue() { + return originValue; + } + + public void setOriginValue(String originValue) { + this.originValue = originValue; + } + + public String getOverallDimension() { + return overallDimension; + } + + public void setOverallDimension(String overallDimension) { + this.overallDimension = overallDimension; + } + + public String getPresentOriginValue() { + return presentOriginValue; + } + + public void setPresentOriginValue(String presentOriginValue) { + this.presentOriginValue = presentOriginValue; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getSinglePrice() { + return singlePrice; + } + + public void setSinglePrice(String singlePrice) { + this.singlePrice = singlePrice; + } + + public String getSupportStandardEquipmentName() { + return supportStandardEquipmentName; + } + + public void setSupportStandardEquipmentName(String supportStandardEquipmentName) { + this.supportStandardEquipmentName = supportStandardEquipmentName; + } + + public String getSupportStandardEquipmentNo() { + return supportStandardEquipmentNo; + } + + public void setSupportStandardEquipmentNo(String supportStandardEquipmentNo) { + this.supportStandardEquipmentNo = supportStandardEquipmentNo; + } + + public String getTechnicalLevel() { + return technicalLevel; + } + + public void setTechnicalLevel(String technicalLevel) { + this.technicalLevel = technicalLevel; + } + + public String getUncertainty() { + return uncertainty; + } + + public void setUncertainty(String uncertainty) { + this.uncertainty = uncertainty; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getUseDept() { + return useDept; + } + + public void setUseDept(String useDept) { + this.useDept = useDept; + } + + public String getUseDeptName() { + return useDeptName; + } + + public void setUseDeptName(String useDeptName) { + this.useDeptName = useDeptName; + } + + public String getUsePerson() { + return usePerson; + } + + public void setUsePerson(String usePerson) { + this.usePerson = usePerson; + } + + public String getUsePersonName() { + return usePersonName; + } + + public void setUsePersonName(String usePersonName) { + this.usePersonName = usePersonName; + } + + public String getValidDate() { + return validDate; + } + + public void setValidDate(String validDate) { + this.validDate = validDate; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getWeight() { + return weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } + } + } +} diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt index c4eb16d..cb371ab 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt @@ -282,6 +282,26 @@ suspend fun getRemindEquipmentCount(@Header("token") token: String): String /** + * 获取到期设备列表 + */ + @POST("/meter/assets/remindListPage") + suspend fun getRemindEquipmentList( + @Header("token") token: String, + @Body requestBody: RequestBody, + @QueryMap limit: Map, + @QueryMap offset: Map + ): String + + /** + * 催办设备 + */ + @POST("/meter/assets/remindWorker") + suspend fun remindEquipment( + @Header("token") token: String, + @Body requestBody: RequestBody + ): String + + /** * 获取到期仪器数 */ @GET("/meter/standard/remindQuantity") diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt index 8b385fa..613e881 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt @@ -317,7 +317,6 @@ offset: Int ): String { val param = JsonObject() - param.addProperty("sid", "username") param.addProperty("equipmentNo", equipmentNo) param.addProperty("equipmentName", equipmentName) param.addProperty("mesureType", mesureType) @@ -606,6 +605,84 @@ } /** + * 获取到期设备列表 + */ + suspend fun getRemindEquipmentList( + managerState: String, + abc: String, + mesureType: String, + isCalibrationTestEquipment: String, + equipmentCategory: String, + useDept: String, + equipmentNo: String, + modelNo: String, + assetNo: String, + assetType: String, + isFixedAssets: String, + equipmentSpecifications: String, + labelId: String, + usePerson: String, + ids: Array, + equipmentName: String, + id: String, + validDateStart: String, + isStandardSupportEquipment: String, + isMeasureAccount: String, + manufacturingNo: String, + validDateEnd: String, + offset: Int + ): String { + val param = JsonObject() + param.addProperty("managerState", managerState) + param.addProperty("abc", abc) + param.addProperty("mesureType", mesureType) + param.addProperty("isCalibrationTestEquipment", isCalibrationTestEquipment) + param.addProperty("equipmentCategory", equipmentCategory) + param.addProperty("useDept", useDept) + param.addProperty("equipmentNo", equipmentNo) + param.addProperty("modelNo", modelNo) + param.addProperty("assetNo", assetNo) + param.addProperty("assetType", assetType) + param.addProperty("isFixedAssets", isFixedAssets) + param.addProperty("equipmentSpecifications", equipmentSpecifications) + param.addProperty("labelId", labelId) + param.addProperty("usePerson", usePerson) + param.add("ids", gson.toJsonTree(ids, typeToken).asJsonArray) + param.addProperty("equipmentName", equipmentName) + param.addProperty("id", id) + param.addProperty("validDateStart", validDateStart) + param.addProperty("isStandardSupportEquipment", isStandardSupportEquipment) + param.addProperty("isMeasureAccount", isMeasureAccount) + param.addProperty("manufacturingNo", manufacturingNo) + param.addProperty("validDateEnd", validDateEnd) + + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + + val limitMap = HashMap() + limitMap["limit"] = LocaleConstant.PAGE_LIMIT + + val offsetMap = HashMap() + offsetMap["offset"] = offset + return api.getRemindEquipmentList( + AuthenticationHelper.token!!, requestBody, limitMap, offsetMap + ) + } + + /** + * 催办设备 + */ + suspend fun remindEquipment(id: String): String { + val param = JsonObject() + param.addProperty("id", id) + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + return api.remindEquipment(AuthenticationHelper.token!!, requestBody) + } + + /** * 获取到期仪器数 */ suspend fun getRemindDeviceCount(): String { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt index 9fa4040..2d0126a 100644 --- a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt +++ b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt @@ -130,12 +130,14 @@ override fun initEvent() { leftBackView.setOnClickListener { finish() } + //设备 equipOvertimeLayout.setOnClickListener { - + navigatePageTo() } + //装置 deviceOvertimeLayout.setOnClickListener { - + navigatePageTo() } workTimeLayout.setOnClickListener { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95f17d4..9bc098c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,6 +75,7 @@ + diff --git a/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java new file mode 100644 index 0000000..4f51e23 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java @@ -0,0 +1,724 @@ +package com.casic.xz.meterage.model; + +import java.util.List; + +public class RemindEquipmentListModel { + + private int code; + private DataModel data; + private String message; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataModel getData() { + return data; + } + + public void setData(DataModel data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static class DataModel { + private List rows; + private int total; + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public static class RowsModel { + private String abc; + private String abcName; + private String applyRelationId; + private String assetNo; + private String assetSource; + private String assetType; + private String assetTypeName; + private String attribute; + private String capitalSource; + private String capitalSourceName; + private String cardEstablishmentDate; + private String compulsoryVerification; + private String createTime; + private String createUser; + private String depreciationMethod; + private String depreciationMethodName; + private String depreciationPeriod; + private String enableDate; + private String equipmentCategory; + private String equipmentCategoryName; + private String equipmentName; + private String equipmentNo; + private String equipmentSpecifications; + private String equipmentType; + private String equipmentTypeName; + private String fileList; + private String id; + private String installIncidentalExpenses; + private String installPlace; + private String intactState; + private String isCalibrationTestEquipment; + private String isDel; + private String isFixedAssets; + private String isMeasureAccount; + private String isStandardSupportEquipment; + private String labelBind; + private String majorCategory; + private String majorCategoryName; + private String managerLevel; + private String managerLevelName; + private String managerState; + private String managerStateName; + private String manufacturer; + private String manufacturerCountry; + private String manufacturingDate; + private String manufacturingNo; + private String mesureCycle; + private String mesureDate; + private String mesureDept; + private String mesureDeptName; + private String mesureRange; + private String mesureResult; + private String mesureResultName; + private String mesureType; + private String mesureTypeName; + private String modelNo; + private String originValue; + private String overallDimension; + private String presentOriginValue; + private String purpose; + private String remark; + private String singlePrice; + private String supportStandardEquipmentName; + private String supportStandardEquipmentNo; + private String technicalLevel; + private String uncertainty; + private String updateTime; + private String useDept; + private String useDeptName; + private String usePerson; + private String usePersonName; + private String validDate; + private String version; + private String weight; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public String getAbcName() { + return abcName; + } + + public void setAbcName(String abcName) { + this.abcName = abcName; + } + + public String getApplyRelationId() { + return applyRelationId; + } + + public void setApplyRelationId(String applyRelationId) { + this.applyRelationId = applyRelationId; + } + + public String getAssetNo() { + return assetNo; + } + + public void setAssetNo(String assetNo) { + this.assetNo = assetNo; + } + + public String getAssetSource() { + return assetSource; + } + + public void setAssetSource(String assetSource) { + this.assetSource = assetSource; + } + + public String getAssetType() { + return assetType; + } + + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + public String getAssetTypeName() { + return assetTypeName; + } + + public void setAssetTypeName(String assetTypeName) { + this.assetTypeName = assetTypeName; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getCapitalSource() { + return capitalSource; + } + + public void setCapitalSource(String capitalSource) { + this.capitalSource = capitalSource; + } + + public String getCapitalSourceName() { + return capitalSourceName; + } + + public void setCapitalSourceName(String capitalSourceName) { + this.capitalSourceName = capitalSourceName; + } + + public String getCardEstablishmentDate() { + return cardEstablishmentDate; + } + + public void setCardEstablishmentDate(String cardEstablishmentDate) { + this.cardEstablishmentDate = cardEstablishmentDate; + } + + public String getCompulsoryVerification() { + return compulsoryVerification; + } + + public void setCompulsoryVerification(String compulsoryVerification) { + this.compulsoryVerification = compulsoryVerification; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getDepreciationMethod() { + return depreciationMethod; + } + + public void setDepreciationMethod(String depreciationMethod) { + this.depreciationMethod = depreciationMethod; + } + + public String getDepreciationMethodName() { + return depreciationMethodName; + } + + public void setDepreciationMethodName(String depreciationMethodName) { + this.depreciationMethodName = depreciationMethodName; + } + + public String getDepreciationPeriod() { + return depreciationPeriod; + } + + public void setDepreciationPeriod(String depreciationPeriod) { + this.depreciationPeriod = depreciationPeriod; + } + + public String getEnableDate() { + return enableDate; + } + + public void setEnableDate(String enableDate) { + this.enableDate = enableDate; + } + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + + public String getEquipmentCategoryName() { + return equipmentCategoryName; + } + + public void setEquipmentCategoryName(String equipmentCategoryName) { + this.equipmentCategoryName = equipmentCategoryName; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentNo() { + return equipmentNo; + } + + public void setEquipmentNo(String equipmentNo) { + this.equipmentNo = equipmentNo; + } + + public String getEquipmentSpecifications() { + return equipmentSpecifications; + } + + public void setEquipmentSpecifications(String equipmentSpecifications) { + this.equipmentSpecifications = equipmentSpecifications; + } + + public String getEquipmentType() { + return equipmentType; + } + + public void setEquipmentType(String equipmentType) { + this.equipmentType = equipmentType; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getFileList() { + return fileList; + } + + public void setFileList(String fileList) { + this.fileList = fileList; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInstallIncidentalExpenses() { + return installIncidentalExpenses; + } + + public void setInstallIncidentalExpenses(String installIncidentalExpenses) { + this.installIncidentalExpenses = installIncidentalExpenses; + } + + public String getInstallPlace() { + return installPlace; + } + + public void setInstallPlace(String installPlace) { + this.installPlace = installPlace; + } + + public String getIntactState() { + return intactState; + } + + public void setIntactState(String intactState) { + this.intactState = intactState; + } + + public String getIsCalibrationTestEquipment() { + return isCalibrationTestEquipment; + } + + public void setIsCalibrationTestEquipment(String isCalibrationTestEquipment) { + this.isCalibrationTestEquipment = isCalibrationTestEquipment; + } + + public String getIsDel() { + return isDel; + } + + public void setIsDel(String isDel) { + this.isDel = isDel; + } + + public String getIsFixedAssets() { + return isFixedAssets; + } + + public void setIsFixedAssets(String isFixedAssets) { + this.isFixedAssets = isFixedAssets; + } + + public String getIsMeasureAccount() { + return isMeasureAccount; + } + + public void setIsMeasureAccount(String isMeasureAccount) { + this.isMeasureAccount = isMeasureAccount; + } + + public String getIsStandardSupportEquipment() { + return isStandardSupportEquipment; + } + + public void setIsStandardSupportEquipment(String isStandardSupportEquipment) { + this.isStandardSupportEquipment = isStandardSupportEquipment; + } + + public String getLabelBind() { + return labelBind; + } + + public void setLabelBind(String labelBind) { + this.labelBind = labelBind; + } + + public String getMajorCategory() { + return majorCategory; + } + + public void setMajorCategory(String majorCategory) { + this.majorCategory = majorCategory; + } + + public String getMajorCategoryName() { + return majorCategoryName; + } + + public void setMajorCategoryName(String majorCategoryName) { + this.majorCategoryName = majorCategoryName; + } + + public String getManagerLevel() { + return managerLevel; + } + + public void setManagerLevel(String managerLevel) { + this.managerLevel = managerLevel; + } + + public String getManagerLevelName() { + return managerLevelName; + } + + public void setManagerLevelName(String managerLevelName) { + this.managerLevelName = managerLevelName; + } + + public String getManagerState() { + return managerState; + } + + public void setManagerState(String managerState) { + this.managerState = managerState; + } + + public String getManagerStateName() { + return managerStateName; + } + + public void setManagerStateName(String managerStateName) { + this.managerStateName = managerStateName; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturerCountry() { + return manufacturerCountry; + } + + public void setManufacturerCountry(String manufacturerCountry) { + this.manufacturerCountry = manufacturerCountry; + } + + public String getManufacturingDate() { + return manufacturingDate; + } + + public void setManufacturingDate(String manufacturingDate) { + this.manufacturingDate = manufacturingDate; + } + + public String getManufacturingNo() { + return manufacturingNo; + } + + public void setManufacturingNo(String manufacturingNo) { + this.manufacturingNo = manufacturingNo; + } + + public String getMesureCycle() { + return mesureCycle; + } + + public void setMesureCycle(String mesureCycle) { + this.mesureCycle = mesureCycle; + } + + public String getMesureDate() { + return mesureDate; + } + + public void setMesureDate(String mesureDate) { + this.mesureDate = mesureDate; + } + + public String getMesureDept() { + return mesureDept; + } + + public void setMesureDept(String mesureDept) { + this.mesureDept = mesureDept; + } + + public String getMesureDeptName() { + return mesureDeptName; + } + + public void setMesureDeptName(String mesureDeptName) { + this.mesureDeptName = mesureDeptName; + } + + public String getMesureRange() { + return mesureRange; + } + + public void setMesureRange(String mesureRange) { + this.mesureRange = mesureRange; + } + + public String getMesureResult() { + return mesureResult; + } + + public void setMesureResult(String mesureResult) { + this.mesureResult = mesureResult; + } + + public String getMesureResultName() { + return mesureResultName; + } + + public void setMesureResultName(String mesureResultName) { + this.mesureResultName = mesureResultName; + } + + public String getMesureType() { + return mesureType; + } + + public void setMesureType(String mesureType) { + this.mesureType = mesureType; + } + + public String getMesureTypeName() { + return mesureTypeName; + } + + public void setMesureTypeName(String mesureTypeName) { + this.mesureTypeName = mesureTypeName; + } + + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getOriginValue() { + return originValue; + } + + public void setOriginValue(String originValue) { + this.originValue = originValue; + } + + public String getOverallDimension() { + return overallDimension; + } + + public void setOverallDimension(String overallDimension) { + this.overallDimension = overallDimension; + } + + public String getPresentOriginValue() { + return presentOriginValue; + } + + public void setPresentOriginValue(String presentOriginValue) { + this.presentOriginValue = presentOriginValue; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getSinglePrice() { + return singlePrice; + } + + public void setSinglePrice(String singlePrice) { + this.singlePrice = singlePrice; + } + + public String getSupportStandardEquipmentName() { + return supportStandardEquipmentName; + } + + public void setSupportStandardEquipmentName(String supportStandardEquipmentName) { + this.supportStandardEquipmentName = supportStandardEquipmentName; + } + + public String getSupportStandardEquipmentNo() { + return supportStandardEquipmentNo; + } + + public void setSupportStandardEquipmentNo(String supportStandardEquipmentNo) { + this.supportStandardEquipmentNo = supportStandardEquipmentNo; + } + + public String getTechnicalLevel() { + return technicalLevel; + } + + public void setTechnicalLevel(String technicalLevel) { + this.technicalLevel = technicalLevel; + } + + public String getUncertainty() { + return uncertainty; + } + + public void setUncertainty(String uncertainty) { + this.uncertainty = uncertainty; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getUseDept() { + return useDept; + } + + public void setUseDept(String useDept) { + this.useDept = useDept; + } + + public String getUseDeptName() { + return useDeptName; + } + + public void setUseDeptName(String useDeptName) { + this.useDeptName = useDeptName; + } + + public String getUsePerson() { + return usePerson; + } + + public void setUsePerson(String usePerson) { + this.usePerson = usePerson; + } + + public String getUsePersonName() { + return usePersonName; + } + + public void setUsePersonName(String usePersonName) { + this.usePersonName = usePersonName; + } + + public String getValidDate() { + return validDate; + } + + public void setValidDate(String validDate) { + this.validDate = validDate; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getWeight() { + return weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } + } + } +} diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt index c4eb16d..cb371ab 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt @@ -282,6 +282,26 @@ suspend fun getRemindEquipmentCount(@Header("token") token: String): String /** + * 获取到期设备列表 + */ + @POST("/meter/assets/remindListPage") + suspend fun getRemindEquipmentList( + @Header("token") token: String, + @Body requestBody: RequestBody, + @QueryMap limit: Map, + @QueryMap offset: Map + ): String + + /** + * 催办设备 + */ + @POST("/meter/assets/remindWorker") + suspend fun remindEquipment( + @Header("token") token: String, + @Body requestBody: RequestBody + ): String + + /** * 获取到期仪器数 */ @GET("/meter/standard/remindQuantity") diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt index 8b385fa..613e881 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt @@ -317,7 +317,6 @@ offset: Int ): String { val param = JsonObject() - param.addProperty("sid", "username") param.addProperty("equipmentNo", equipmentNo) param.addProperty("equipmentName", equipmentName) param.addProperty("mesureType", mesureType) @@ -606,6 +605,84 @@ } /** + * 获取到期设备列表 + */ + suspend fun getRemindEquipmentList( + managerState: String, + abc: String, + mesureType: String, + isCalibrationTestEquipment: String, + equipmentCategory: String, + useDept: String, + equipmentNo: String, + modelNo: String, + assetNo: String, + assetType: String, + isFixedAssets: String, + equipmentSpecifications: String, + labelId: String, + usePerson: String, + ids: Array, + equipmentName: String, + id: String, + validDateStart: String, + isStandardSupportEquipment: String, + isMeasureAccount: String, + manufacturingNo: String, + validDateEnd: String, + offset: Int + ): String { + val param = JsonObject() + param.addProperty("managerState", managerState) + param.addProperty("abc", abc) + param.addProperty("mesureType", mesureType) + param.addProperty("isCalibrationTestEquipment", isCalibrationTestEquipment) + param.addProperty("equipmentCategory", equipmentCategory) + param.addProperty("useDept", useDept) + param.addProperty("equipmentNo", equipmentNo) + param.addProperty("modelNo", modelNo) + param.addProperty("assetNo", assetNo) + param.addProperty("assetType", assetType) + param.addProperty("isFixedAssets", isFixedAssets) + param.addProperty("equipmentSpecifications", equipmentSpecifications) + param.addProperty("labelId", labelId) + param.addProperty("usePerson", usePerson) + param.add("ids", gson.toJsonTree(ids, typeToken).asJsonArray) + param.addProperty("equipmentName", equipmentName) + param.addProperty("id", id) + param.addProperty("validDateStart", validDateStart) + param.addProperty("isStandardSupportEquipment", isStandardSupportEquipment) + param.addProperty("isMeasureAccount", isMeasureAccount) + param.addProperty("manufacturingNo", manufacturingNo) + param.addProperty("validDateEnd", validDateEnd) + + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + + val limitMap = HashMap() + limitMap["limit"] = LocaleConstant.PAGE_LIMIT + + val offsetMap = HashMap() + offsetMap["offset"] = offset + return api.getRemindEquipmentList( + AuthenticationHelper.token!!, requestBody, limitMap, offsetMap + ) + } + + /** + * 催办设备 + */ + suspend fun remindEquipment(id: String): String { + val param = JsonObject() + param.addProperty("id", id) + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + return api.remindEquipment(AuthenticationHelper.token!!, requestBody) + } + + /** * 获取到期仪器数 */ suspend fun getRemindDeviceCount(): String { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt index 9fa4040..2d0126a 100644 --- a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt +++ b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt @@ -130,12 +130,14 @@ override fun initEvent() { leftBackView.setOnClickListener { finish() } + //设备 equipOvertimeLayout.setOnClickListener { - + navigatePageTo() } + //装置 deviceOvertimeLayout.setOnClickListener { - + navigatePageTo() } workTimeLayout.setOnClickListener { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt new file mode 100644 index 0000000..35a5837 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt @@ -0,0 +1,4 @@ +package com.casic.xz.meterage.view.home + +class OvertimeDeviceActivity { +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95f17d4..9bc098c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,6 +75,7 @@ + diff --git a/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java new file mode 100644 index 0000000..4f51e23 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java @@ -0,0 +1,724 @@ +package com.casic.xz.meterage.model; + +import java.util.List; + +public class RemindEquipmentListModel { + + private int code; + private DataModel data; + private String message; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataModel getData() { + return data; + } + + public void setData(DataModel data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static class DataModel { + private List rows; + private int total; + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public static class RowsModel { + private String abc; + private String abcName; + private String applyRelationId; + private String assetNo; + private String assetSource; + private String assetType; + private String assetTypeName; + private String attribute; + private String capitalSource; + private String capitalSourceName; + private String cardEstablishmentDate; + private String compulsoryVerification; + private String createTime; + private String createUser; + private String depreciationMethod; + private String depreciationMethodName; + private String depreciationPeriod; + private String enableDate; + private String equipmentCategory; + private String equipmentCategoryName; + private String equipmentName; + private String equipmentNo; + private String equipmentSpecifications; + private String equipmentType; + private String equipmentTypeName; + private String fileList; + private String id; + private String installIncidentalExpenses; + private String installPlace; + private String intactState; + private String isCalibrationTestEquipment; + private String isDel; + private String isFixedAssets; + private String isMeasureAccount; + private String isStandardSupportEquipment; + private String labelBind; + private String majorCategory; + private String majorCategoryName; + private String managerLevel; + private String managerLevelName; + private String managerState; + private String managerStateName; + private String manufacturer; + private String manufacturerCountry; + private String manufacturingDate; + private String manufacturingNo; + private String mesureCycle; + private String mesureDate; + private String mesureDept; + private String mesureDeptName; + private String mesureRange; + private String mesureResult; + private String mesureResultName; + private String mesureType; + private String mesureTypeName; + private String modelNo; + private String originValue; + private String overallDimension; + private String presentOriginValue; + private String purpose; + private String remark; + private String singlePrice; + private String supportStandardEquipmentName; + private String supportStandardEquipmentNo; + private String technicalLevel; + private String uncertainty; + private String updateTime; + private String useDept; + private String useDeptName; + private String usePerson; + private String usePersonName; + private String validDate; + private String version; + private String weight; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public String getAbcName() { + return abcName; + } + + public void setAbcName(String abcName) { + this.abcName = abcName; + } + + public String getApplyRelationId() { + return applyRelationId; + } + + public void setApplyRelationId(String applyRelationId) { + this.applyRelationId = applyRelationId; + } + + public String getAssetNo() { + return assetNo; + } + + public void setAssetNo(String assetNo) { + this.assetNo = assetNo; + } + + public String getAssetSource() { + return assetSource; + } + + public void setAssetSource(String assetSource) { + this.assetSource = assetSource; + } + + public String getAssetType() { + return assetType; + } + + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + public String getAssetTypeName() { + return assetTypeName; + } + + public void setAssetTypeName(String assetTypeName) { + this.assetTypeName = assetTypeName; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getCapitalSource() { + return capitalSource; + } + + public void setCapitalSource(String capitalSource) { + this.capitalSource = capitalSource; + } + + public String getCapitalSourceName() { + return capitalSourceName; + } + + public void setCapitalSourceName(String capitalSourceName) { + this.capitalSourceName = capitalSourceName; + } + + public String getCardEstablishmentDate() { + return cardEstablishmentDate; + } + + public void setCardEstablishmentDate(String cardEstablishmentDate) { + this.cardEstablishmentDate = cardEstablishmentDate; + } + + public String getCompulsoryVerification() { + return compulsoryVerification; + } + + public void setCompulsoryVerification(String compulsoryVerification) { + this.compulsoryVerification = compulsoryVerification; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getDepreciationMethod() { + return depreciationMethod; + } + + public void setDepreciationMethod(String depreciationMethod) { + this.depreciationMethod = depreciationMethod; + } + + public String getDepreciationMethodName() { + return depreciationMethodName; + } + + public void setDepreciationMethodName(String depreciationMethodName) { + this.depreciationMethodName = depreciationMethodName; + } + + public String getDepreciationPeriod() { + return depreciationPeriod; + } + + public void setDepreciationPeriod(String depreciationPeriod) { + this.depreciationPeriod = depreciationPeriod; + } + + public String getEnableDate() { + return enableDate; + } + + public void setEnableDate(String enableDate) { + this.enableDate = enableDate; + } + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + + public String getEquipmentCategoryName() { + return equipmentCategoryName; + } + + public void setEquipmentCategoryName(String equipmentCategoryName) { + this.equipmentCategoryName = equipmentCategoryName; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentNo() { + return equipmentNo; + } + + public void setEquipmentNo(String equipmentNo) { + this.equipmentNo = equipmentNo; + } + + public String getEquipmentSpecifications() { + return equipmentSpecifications; + } + + public void setEquipmentSpecifications(String equipmentSpecifications) { + this.equipmentSpecifications = equipmentSpecifications; + } + + public String getEquipmentType() { + return equipmentType; + } + + public void setEquipmentType(String equipmentType) { + this.equipmentType = equipmentType; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getFileList() { + return fileList; + } + + public void setFileList(String fileList) { + this.fileList = fileList; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInstallIncidentalExpenses() { + return installIncidentalExpenses; + } + + public void setInstallIncidentalExpenses(String installIncidentalExpenses) { + this.installIncidentalExpenses = installIncidentalExpenses; + } + + public String getInstallPlace() { + return installPlace; + } + + public void setInstallPlace(String installPlace) { + this.installPlace = installPlace; + } + + public String getIntactState() { + return intactState; + } + + public void setIntactState(String intactState) { + this.intactState = intactState; + } + + public String getIsCalibrationTestEquipment() { + return isCalibrationTestEquipment; + } + + public void setIsCalibrationTestEquipment(String isCalibrationTestEquipment) { + this.isCalibrationTestEquipment = isCalibrationTestEquipment; + } + + public String getIsDel() { + return isDel; + } + + public void setIsDel(String isDel) { + this.isDel = isDel; + } + + public String getIsFixedAssets() { + return isFixedAssets; + } + + public void setIsFixedAssets(String isFixedAssets) { + this.isFixedAssets = isFixedAssets; + } + + public String getIsMeasureAccount() { + return isMeasureAccount; + } + + public void setIsMeasureAccount(String isMeasureAccount) { + this.isMeasureAccount = isMeasureAccount; + } + + public String getIsStandardSupportEquipment() { + return isStandardSupportEquipment; + } + + public void setIsStandardSupportEquipment(String isStandardSupportEquipment) { + this.isStandardSupportEquipment = isStandardSupportEquipment; + } + + public String getLabelBind() { + return labelBind; + } + + public void setLabelBind(String labelBind) { + this.labelBind = labelBind; + } + + public String getMajorCategory() { + return majorCategory; + } + + public void setMajorCategory(String majorCategory) { + this.majorCategory = majorCategory; + } + + public String getMajorCategoryName() { + return majorCategoryName; + } + + public void setMajorCategoryName(String majorCategoryName) { + this.majorCategoryName = majorCategoryName; + } + + public String getManagerLevel() { + return managerLevel; + } + + public void setManagerLevel(String managerLevel) { + this.managerLevel = managerLevel; + } + + public String getManagerLevelName() { + return managerLevelName; + } + + public void setManagerLevelName(String managerLevelName) { + this.managerLevelName = managerLevelName; + } + + public String getManagerState() { + return managerState; + } + + public void setManagerState(String managerState) { + this.managerState = managerState; + } + + public String getManagerStateName() { + return managerStateName; + } + + public void setManagerStateName(String managerStateName) { + this.managerStateName = managerStateName; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturerCountry() { + return manufacturerCountry; + } + + public void setManufacturerCountry(String manufacturerCountry) { + this.manufacturerCountry = manufacturerCountry; + } + + public String getManufacturingDate() { + return manufacturingDate; + } + + public void setManufacturingDate(String manufacturingDate) { + this.manufacturingDate = manufacturingDate; + } + + public String getManufacturingNo() { + return manufacturingNo; + } + + public void setManufacturingNo(String manufacturingNo) { + this.manufacturingNo = manufacturingNo; + } + + public String getMesureCycle() { + return mesureCycle; + } + + public void setMesureCycle(String mesureCycle) { + this.mesureCycle = mesureCycle; + } + + public String getMesureDate() { + return mesureDate; + } + + public void setMesureDate(String mesureDate) { + this.mesureDate = mesureDate; + } + + public String getMesureDept() { + return mesureDept; + } + + public void setMesureDept(String mesureDept) { + this.mesureDept = mesureDept; + } + + public String getMesureDeptName() { + return mesureDeptName; + } + + public void setMesureDeptName(String mesureDeptName) { + this.mesureDeptName = mesureDeptName; + } + + public String getMesureRange() { + return mesureRange; + } + + public void setMesureRange(String mesureRange) { + this.mesureRange = mesureRange; + } + + public String getMesureResult() { + return mesureResult; + } + + public void setMesureResult(String mesureResult) { + this.mesureResult = mesureResult; + } + + public String getMesureResultName() { + return mesureResultName; + } + + public void setMesureResultName(String mesureResultName) { + this.mesureResultName = mesureResultName; + } + + public String getMesureType() { + return mesureType; + } + + public void setMesureType(String mesureType) { + this.mesureType = mesureType; + } + + public String getMesureTypeName() { + return mesureTypeName; + } + + public void setMesureTypeName(String mesureTypeName) { + this.mesureTypeName = mesureTypeName; + } + + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getOriginValue() { + return originValue; + } + + public void setOriginValue(String originValue) { + this.originValue = originValue; + } + + public String getOverallDimension() { + return overallDimension; + } + + public void setOverallDimension(String overallDimension) { + this.overallDimension = overallDimension; + } + + public String getPresentOriginValue() { + return presentOriginValue; + } + + public void setPresentOriginValue(String presentOriginValue) { + this.presentOriginValue = presentOriginValue; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getSinglePrice() { + return singlePrice; + } + + public void setSinglePrice(String singlePrice) { + this.singlePrice = singlePrice; + } + + public String getSupportStandardEquipmentName() { + return supportStandardEquipmentName; + } + + public void setSupportStandardEquipmentName(String supportStandardEquipmentName) { + this.supportStandardEquipmentName = supportStandardEquipmentName; + } + + public String getSupportStandardEquipmentNo() { + return supportStandardEquipmentNo; + } + + public void setSupportStandardEquipmentNo(String supportStandardEquipmentNo) { + this.supportStandardEquipmentNo = supportStandardEquipmentNo; + } + + public String getTechnicalLevel() { + return technicalLevel; + } + + public void setTechnicalLevel(String technicalLevel) { + this.technicalLevel = technicalLevel; + } + + public String getUncertainty() { + return uncertainty; + } + + public void setUncertainty(String uncertainty) { + this.uncertainty = uncertainty; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getUseDept() { + return useDept; + } + + public void setUseDept(String useDept) { + this.useDept = useDept; + } + + public String getUseDeptName() { + return useDeptName; + } + + public void setUseDeptName(String useDeptName) { + this.useDeptName = useDeptName; + } + + public String getUsePerson() { + return usePerson; + } + + public void setUsePerson(String usePerson) { + this.usePerson = usePerson; + } + + public String getUsePersonName() { + return usePersonName; + } + + public void setUsePersonName(String usePersonName) { + this.usePersonName = usePersonName; + } + + public String getValidDate() { + return validDate; + } + + public void setValidDate(String validDate) { + this.validDate = validDate; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getWeight() { + return weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } + } + } +} diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt index c4eb16d..cb371ab 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt @@ -282,6 +282,26 @@ suspend fun getRemindEquipmentCount(@Header("token") token: String): String /** + * 获取到期设备列表 + */ + @POST("/meter/assets/remindListPage") + suspend fun getRemindEquipmentList( + @Header("token") token: String, + @Body requestBody: RequestBody, + @QueryMap limit: Map, + @QueryMap offset: Map + ): String + + /** + * 催办设备 + */ + @POST("/meter/assets/remindWorker") + suspend fun remindEquipment( + @Header("token") token: String, + @Body requestBody: RequestBody + ): String + + /** * 获取到期仪器数 */ @GET("/meter/standard/remindQuantity") diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt index 8b385fa..613e881 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt @@ -317,7 +317,6 @@ offset: Int ): String { val param = JsonObject() - param.addProperty("sid", "username") param.addProperty("equipmentNo", equipmentNo) param.addProperty("equipmentName", equipmentName) param.addProperty("mesureType", mesureType) @@ -606,6 +605,84 @@ } /** + * 获取到期设备列表 + */ + suspend fun getRemindEquipmentList( + managerState: String, + abc: String, + mesureType: String, + isCalibrationTestEquipment: String, + equipmentCategory: String, + useDept: String, + equipmentNo: String, + modelNo: String, + assetNo: String, + assetType: String, + isFixedAssets: String, + equipmentSpecifications: String, + labelId: String, + usePerson: String, + ids: Array, + equipmentName: String, + id: String, + validDateStart: String, + isStandardSupportEquipment: String, + isMeasureAccount: String, + manufacturingNo: String, + validDateEnd: String, + offset: Int + ): String { + val param = JsonObject() + param.addProperty("managerState", managerState) + param.addProperty("abc", abc) + param.addProperty("mesureType", mesureType) + param.addProperty("isCalibrationTestEquipment", isCalibrationTestEquipment) + param.addProperty("equipmentCategory", equipmentCategory) + param.addProperty("useDept", useDept) + param.addProperty("equipmentNo", equipmentNo) + param.addProperty("modelNo", modelNo) + param.addProperty("assetNo", assetNo) + param.addProperty("assetType", assetType) + param.addProperty("isFixedAssets", isFixedAssets) + param.addProperty("equipmentSpecifications", equipmentSpecifications) + param.addProperty("labelId", labelId) + param.addProperty("usePerson", usePerson) + param.add("ids", gson.toJsonTree(ids, typeToken).asJsonArray) + param.addProperty("equipmentName", equipmentName) + param.addProperty("id", id) + param.addProperty("validDateStart", validDateStart) + param.addProperty("isStandardSupportEquipment", isStandardSupportEquipment) + param.addProperty("isMeasureAccount", isMeasureAccount) + param.addProperty("manufacturingNo", manufacturingNo) + param.addProperty("validDateEnd", validDateEnd) + + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + + val limitMap = HashMap() + limitMap["limit"] = LocaleConstant.PAGE_LIMIT + + val offsetMap = HashMap() + offsetMap["offset"] = offset + return api.getRemindEquipmentList( + AuthenticationHelper.token!!, requestBody, limitMap, offsetMap + ) + } + + /** + * 催办设备 + */ + suspend fun remindEquipment(id: String): String { + val param = JsonObject() + param.addProperty("id", id) + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + return api.remindEquipment(AuthenticationHelper.token!!, requestBody) + } + + /** * 获取到期仪器数 */ suspend fun getRemindDeviceCount(): String { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt index 9fa4040..2d0126a 100644 --- a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt +++ b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt @@ -130,12 +130,14 @@ override fun initEvent() { leftBackView.setOnClickListener { finish() } + //设备 equipOvertimeLayout.setOnClickListener { - + navigatePageTo() } + //装置 deviceOvertimeLayout.setOnClickListener { - + navigatePageTo() } workTimeLayout.setOnClickListener { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt new file mode 100644 index 0000000..35a5837 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt @@ -0,0 +1,4 @@ +package com.casic.xz.meterage.view.home + +class OvertimeDeviceActivity { +} \ No newline at end of file diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt new file mode 100644 index 0000000..717e6b2 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt @@ -0,0 +1,264 @@ +package com.casic.xz.meterage.view.home + +import android.content.Context +import android.os.Handler +import androidx.lifecycle.ViewModelProvider +import androidx.recyclerview.widget.DividerItemDecoration +import com.casic.xz.meterage.R +import com.casic.xz.meterage.base.ApplicationBaseActivity +import com.casic.xz.meterage.extensions.formatToYearMonthDay +import com.casic.xz.meterage.extensions.initLayoutImmersionBar +import com.casic.xz.meterage.extensions.isEarlierThenCurrent +import com.casic.xz.meterage.extensions.showEmptyPage +import com.casic.xz.meterage.model.RemindEquipmentListModel +import com.casic.xz.meterage.utils.LoadingDialogHub +import com.casic.xz.meterage.vm.EquipmentViewModel +import com.gyf.immersionbar.ImmersionBar +import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter +import com.pengxh.kt.lite.adapter.ViewHolder +import com.pengxh.kt.lite.extensions.convertColor +import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.extensions.show +import com.pengxh.kt.lite.utils.WeakReferenceHandler +import com.pengxh.kt.lite.vm.LoadState +import com.pengxh.kt.lite.widget.dialog.AlertControlDialog +import kotlinx.android.synthetic.main.activity_overtime_equip.* +import kotlinx.android.synthetic.main.include_empty_view.* +import kotlinx.android.synthetic.main.include_search_title.* + +class OvertimeEquipActivity : ApplicationBaseActivity() { + + private var context: Context = this@OvertimeEquipActivity + private lateinit var weakReferenceHandler: WeakReferenceHandler + private lateinit var equipmentViewModel: EquipmentViewModel + private lateinit var equipmentAdapter: NormalRecyclerAdapter + private var dataBeans: MutableList = ArrayList() + private var pageIndex = 1 + private var isRefresh = false + private var isLoadMore = false + private var clickedPosition = 0 + + override fun initLayoutView(): Int = R.layout.activity_overtime_equip + + override fun setupTopBarLayout() { + ImmersionBar.with(this).statusBarDarkFont(true).init() + initLayoutImmersionBar(rootView) + titleView.text = "设备到期列表" + } + + override fun initData() { + weakReferenceHandler = WeakReferenceHandler(callback) + equipmentViewModel = ViewModelProvider(this)[EquipmentViewModel::class.java] + equipmentViewModel.remindEquipmentList.observe(this) { + if (it.code == 200) { + val dataRows = it.data?.rows!! + when { + isRefresh -> { + dataBeans.clear() + dataBeans = dataRows + equipmentLayout.finishRefresh() + isRefresh = false + } + isLoadMore -> { + if (dataRows.size == 0) { + "到底了,别拉了".show(this) + } + dataBeans.addAll(dataRows) + equipmentLayout.finishLoadMore() + isLoadMore = false + } + else -> { + dataBeans = dataRows + } + } + weakReferenceHandler.sendEmptyMessage(2023041801) + } + } + + equipmentViewModel.remindEquipmentResult.observe(this) { + if (it.code == 200) { + //催办之后列表虽然刷新,但是列表依旧存在,只有在对方处理了过期设备,列表还是刷新 + "操作成功".show(this) + } + } + } + + override fun observeRequestState() { + equipmentViewModel.loadState.observe(this) { + when (it) { + LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中...") + else -> LoadingDialogHub.dismiss() + } + } + } + + override fun initEvent() { + leftBackView.setOnClickListener { finish() } + + equipmentLayout.setOnRefreshListener { + isRefresh = true + //刷新之后页码重置 + pageIndex = 1 + getRemindEquipmentListByPage() + } + + equipmentLayout.setOnLoadMoreListener { + isLoadMore = true + pageIndex++ + getRemindEquipmentListByPage() + } + } + + override fun onResume() { + super.onResume() + pageIndex = 1 + getRemindEquipmentListByPage() + } + + private fun getRemindEquipmentListByPage() { + equipmentViewModel.getRemindEquipmentList( + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + arrayOf(), + "", + "", + "", + "", + "", + "", + "", + pageIndex + ) + } + + private val callback = Handler.Callback { + when (it.what) { + 2023041801 -> { + if (isRefresh || isLoadMore) { + equipmentAdapter.notifyDataSetChanged() + } else { + if (dataBeans.size == 0) { + emptyView!!.showEmptyPage("无过期设备") { + pageIndex = 1 + getRemindEquipmentListByPage() + } + } else { + emptyView!!.hide() + equipmentAdapter = object : + NormalRecyclerAdapter( + R.layout.item_remind_equipment_rv_l, dataBeans + ) { + override fun convertView( + viewHolder: ViewHolder, + position: Int, + item: RemindEquipmentListModel.DataModel.RowsModel + ) { + val modelNo = if (item.modelNo.isNullOrBlank()) { + "未知" + } else { + item.modelNo + } + + val remark = if (item.remark.isNullOrBlank()) { + "无" + } else { + item.remark + } + + val useDept = if (item.useDeptName.isNullOrBlank()) { + "未知" + } else { + item.useDeptName + } + + val usePerson = if (item.usePersonName.isNullOrBlank()) { + "无" + } else { + item.usePersonName + } + + if (item.validDate.isEarlierThenCurrent()) { + viewHolder.setTextColor( + R.id.deviceDateView, R.color.red.convertColor(context) + ) + } else { + viewHolder.setTextColor( + R.id.deviceDateView, R.color.gray.convertColor(context) + ) + } + + viewHolder.setText(R.id.equipmentName, item.equipmentName) + .setText(R.id.modelView, modelNo) + .setText(R.id.equipmentStateView, item.managerStateName) + .setText(R.id.equipmentCodeView, "装置编号:${item.equipmentNo}") + .setText(R.id.remarkView, "备注:$remark") + .setText(R.id.useDeptView, useDept) + .setText( + R.id.deviceDateView, + "有效期至:${item.validDate.formatToYearMonthDay()}" + ) + .setText(R.id.usePersonView, "管理员:$usePerson") + + if (!item.managerStateName.contains("在用")) { + viewHolder.setBackgroundColor( + R.id.equipmentStateView, R.color.gray.convertColor(context) + ) + } + + viewHolder.setOnClickListener(R.id.remindButton) { + //标记被点击的item位置 + clickedPosition = position + AlertControlDialog.Builder() + .setContext(context) + .setTitle("提示") + .setMessage("确定催办该设备?") + .setNegativeButton("取消") + .setPositiveButton("确定") + .setOnDialogButtonClickListener(object : + AlertControlDialog.OnDialogButtonClickListener { + override fun onCancelClick() { + + } + + override fun onConfirmClick() { + if (item.id.isBlank()) { + "设备ID异常,无法催办".show(context) + return + } + equipmentViewModel.remindEquipment(item.id) + } + }).build().show() + } + } + } + equipmentRecyclerView.addItemDecoration( + DividerItemDecoration(this, DividerItemDecoration.VERTICAL) + ) + equipmentRecyclerView.adapter = equipmentAdapter + equipmentAdapter.setOnItemClickedListener(object : + NormalRecyclerAdapter.OnItemClickedListener { + override fun onItemClicked( + position: Int, t: RemindEquipmentListModel.DataModel.RowsModel + ) { + navigatePageTo(t.id) + } + }) + } + } + } + } + true + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95f17d4..9bc098c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,6 +75,7 @@ + diff --git a/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java new file mode 100644 index 0000000..4f51e23 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java @@ -0,0 +1,724 @@ +package com.casic.xz.meterage.model; + +import java.util.List; + +public class RemindEquipmentListModel { + + private int code; + private DataModel data; + private String message; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataModel getData() { + return data; + } + + public void setData(DataModel data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static class DataModel { + private List rows; + private int total; + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public static class RowsModel { + private String abc; + private String abcName; + private String applyRelationId; + private String assetNo; + private String assetSource; + private String assetType; + private String assetTypeName; + private String attribute; + private String capitalSource; + private String capitalSourceName; + private String cardEstablishmentDate; + private String compulsoryVerification; + private String createTime; + private String createUser; + private String depreciationMethod; + private String depreciationMethodName; + private String depreciationPeriod; + private String enableDate; + private String equipmentCategory; + private String equipmentCategoryName; + private String equipmentName; + private String equipmentNo; + private String equipmentSpecifications; + private String equipmentType; + private String equipmentTypeName; + private String fileList; + private String id; + private String installIncidentalExpenses; + private String installPlace; + private String intactState; + private String isCalibrationTestEquipment; + private String isDel; + private String isFixedAssets; + private String isMeasureAccount; + private String isStandardSupportEquipment; + private String labelBind; + private String majorCategory; + private String majorCategoryName; + private String managerLevel; + private String managerLevelName; + private String managerState; + private String managerStateName; + private String manufacturer; + private String manufacturerCountry; + private String manufacturingDate; + private String manufacturingNo; + private String mesureCycle; + private String mesureDate; + private String mesureDept; + private String mesureDeptName; + private String mesureRange; + private String mesureResult; + private String mesureResultName; + private String mesureType; + private String mesureTypeName; + private String modelNo; + private String originValue; + private String overallDimension; + private String presentOriginValue; + private String purpose; + private String remark; + private String singlePrice; + private String supportStandardEquipmentName; + private String supportStandardEquipmentNo; + private String technicalLevel; + private String uncertainty; + private String updateTime; + private String useDept; + private String useDeptName; + private String usePerson; + private String usePersonName; + private String validDate; + private String version; + private String weight; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public String getAbcName() { + return abcName; + } + + public void setAbcName(String abcName) { + this.abcName = abcName; + } + + public String getApplyRelationId() { + return applyRelationId; + } + + public void setApplyRelationId(String applyRelationId) { + this.applyRelationId = applyRelationId; + } + + public String getAssetNo() { + return assetNo; + } + + public void setAssetNo(String assetNo) { + this.assetNo = assetNo; + } + + public String getAssetSource() { + return assetSource; + } + + public void setAssetSource(String assetSource) { + this.assetSource = assetSource; + } + + public String getAssetType() { + return assetType; + } + + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + public String getAssetTypeName() { + return assetTypeName; + } + + public void setAssetTypeName(String assetTypeName) { + this.assetTypeName = assetTypeName; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getCapitalSource() { + return capitalSource; + } + + public void setCapitalSource(String capitalSource) { + this.capitalSource = capitalSource; + } + + public String getCapitalSourceName() { + return capitalSourceName; + } + + public void setCapitalSourceName(String capitalSourceName) { + this.capitalSourceName = capitalSourceName; + } + + public String getCardEstablishmentDate() { + return cardEstablishmentDate; + } + + public void setCardEstablishmentDate(String cardEstablishmentDate) { + this.cardEstablishmentDate = cardEstablishmentDate; + } + + public String getCompulsoryVerification() { + return compulsoryVerification; + } + + public void setCompulsoryVerification(String compulsoryVerification) { + this.compulsoryVerification = compulsoryVerification; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getDepreciationMethod() { + return depreciationMethod; + } + + public void setDepreciationMethod(String depreciationMethod) { + this.depreciationMethod = depreciationMethod; + } + + public String getDepreciationMethodName() { + return depreciationMethodName; + } + + public void setDepreciationMethodName(String depreciationMethodName) { + this.depreciationMethodName = depreciationMethodName; + } + + public String getDepreciationPeriod() { + return depreciationPeriod; + } + + public void setDepreciationPeriod(String depreciationPeriod) { + this.depreciationPeriod = depreciationPeriod; + } + + public String getEnableDate() { + return enableDate; + } + + public void setEnableDate(String enableDate) { + this.enableDate = enableDate; + } + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + + public String getEquipmentCategoryName() { + return equipmentCategoryName; + } + + public void setEquipmentCategoryName(String equipmentCategoryName) { + this.equipmentCategoryName = equipmentCategoryName; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentNo() { + return equipmentNo; + } + + public void setEquipmentNo(String equipmentNo) { + this.equipmentNo = equipmentNo; + } + + public String getEquipmentSpecifications() { + return equipmentSpecifications; + } + + public void setEquipmentSpecifications(String equipmentSpecifications) { + this.equipmentSpecifications = equipmentSpecifications; + } + + public String getEquipmentType() { + return equipmentType; + } + + public void setEquipmentType(String equipmentType) { + this.equipmentType = equipmentType; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getFileList() { + return fileList; + } + + public void setFileList(String fileList) { + this.fileList = fileList; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInstallIncidentalExpenses() { + return installIncidentalExpenses; + } + + public void setInstallIncidentalExpenses(String installIncidentalExpenses) { + this.installIncidentalExpenses = installIncidentalExpenses; + } + + public String getInstallPlace() { + return installPlace; + } + + public void setInstallPlace(String installPlace) { + this.installPlace = installPlace; + } + + public String getIntactState() { + return intactState; + } + + public void setIntactState(String intactState) { + this.intactState = intactState; + } + + public String getIsCalibrationTestEquipment() { + return isCalibrationTestEquipment; + } + + public void setIsCalibrationTestEquipment(String isCalibrationTestEquipment) { + this.isCalibrationTestEquipment = isCalibrationTestEquipment; + } + + public String getIsDel() { + return isDel; + } + + public void setIsDel(String isDel) { + this.isDel = isDel; + } + + public String getIsFixedAssets() { + return isFixedAssets; + } + + public void setIsFixedAssets(String isFixedAssets) { + this.isFixedAssets = isFixedAssets; + } + + public String getIsMeasureAccount() { + return isMeasureAccount; + } + + public void setIsMeasureAccount(String isMeasureAccount) { + this.isMeasureAccount = isMeasureAccount; + } + + public String getIsStandardSupportEquipment() { + return isStandardSupportEquipment; + } + + public void setIsStandardSupportEquipment(String isStandardSupportEquipment) { + this.isStandardSupportEquipment = isStandardSupportEquipment; + } + + public String getLabelBind() { + return labelBind; + } + + public void setLabelBind(String labelBind) { + this.labelBind = labelBind; + } + + public String getMajorCategory() { + return majorCategory; + } + + public void setMajorCategory(String majorCategory) { + this.majorCategory = majorCategory; + } + + public String getMajorCategoryName() { + return majorCategoryName; + } + + public void setMajorCategoryName(String majorCategoryName) { + this.majorCategoryName = majorCategoryName; + } + + public String getManagerLevel() { + return managerLevel; + } + + public void setManagerLevel(String managerLevel) { + this.managerLevel = managerLevel; + } + + public String getManagerLevelName() { + return managerLevelName; + } + + public void setManagerLevelName(String managerLevelName) { + this.managerLevelName = managerLevelName; + } + + public String getManagerState() { + return managerState; + } + + public void setManagerState(String managerState) { + this.managerState = managerState; + } + + public String getManagerStateName() { + return managerStateName; + } + + public void setManagerStateName(String managerStateName) { + this.managerStateName = managerStateName; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturerCountry() { + return manufacturerCountry; + } + + public void setManufacturerCountry(String manufacturerCountry) { + this.manufacturerCountry = manufacturerCountry; + } + + public String getManufacturingDate() { + return manufacturingDate; + } + + public void setManufacturingDate(String manufacturingDate) { + this.manufacturingDate = manufacturingDate; + } + + public String getManufacturingNo() { + return manufacturingNo; + } + + public void setManufacturingNo(String manufacturingNo) { + this.manufacturingNo = manufacturingNo; + } + + public String getMesureCycle() { + return mesureCycle; + } + + public void setMesureCycle(String mesureCycle) { + this.mesureCycle = mesureCycle; + } + + public String getMesureDate() { + return mesureDate; + } + + public void setMesureDate(String mesureDate) { + this.mesureDate = mesureDate; + } + + public String getMesureDept() { + return mesureDept; + } + + public void setMesureDept(String mesureDept) { + this.mesureDept = mesureDept; + } + + public String getMesureDeptName() { + return mesureDeptName; + } + + public void setMesureDeptName(String mesureDeptName) { + this.mesureDeptName = mesureDeptName; + } + + public String getMesureRange() { + return mesureRange; + } + + public void setMesureRange(String mesureRange) { + this.mesureRange = mesureRange; + } + + public String getMesureResult() { + return mesureResult; + } + + public void setMesureResult(String mesureResult) { + this.mesureResult = mesureResult; + } + + public String getMesureResultName() { + return mesureResultName; + } + + public void setMesureResultName(String mesureResultName) { + this.mesureResultName = mesureResultName; + } + + public String getMesureType() { + return mesureType; + } + + public void setMesureType(String mesureType) { + this.mesureType = mesureType; + } + + public String getMesureTypeName() { + return mesureTypeName; + } + + public void setMesureTypeName(String mesureTypeName) { + this.mesureTypeName = mesureTypeName; + } + + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getOriginValue() { + return originValue; + } + + public void setOriginValue(String originValue) { + this.originValue = originValue; + } + + public String getOverallDimension() { + return overallDimension; + } + + public void setOverallDimension(String overallDimension) { + this.overallDimension = overallDimension; + } + + public String getPresentOriginValue() { + return presentOriginValue; + } + + public void setPresentOriginValue(String presentOriginValue) { + this.presentOriginValue = presentOriginValue; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getSinglePrice() { + return singlePrice; + } + + public void setSinglePrice(String singlePrice) { + this.singlePrice = singlePrice; + } + + public String getSupportStandardEquipmentName() { + return supportStandardEquipmentName; + } + + public void setSupportStandardEquipmentName(String supportStandardEquipmentName) { + this.supportStandardEquipmentName = supportStandardEquipmentName; + } + + public String getSupportStandardEquipmentNo() { + return supportStandardEquipmentNo; + } + + public void setSupportStandardEquipmentNo(String supportStandardEquipmentNo) { + this.supportStandardEquipmentNo = supportStandardEquipmentNo; + } + + public String getTechnicalLevel() { + return technicalLevel; + } + + public void setTechnicalLevel(String technicalLevel) { + this.technicalLevel = technicalLevel; + } + + public String getUncertainty() { + return uncertainty; + } + + public void setUncertainty(String uncertainty) { + this.uncertainty = uncertainty; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getUseDept() { + return useDept; + } + + public void setUseDept(String useDept) { + this.useDept = useDept; + } + + public String getUseDeptName() { + return useDeptName; + } + + public void setUseDeptName(String useDeptName) { + this.useDeptName = useDeptName; + } + + public String getUsePerson() { + return usePerson; + } + + public void setUsePerson(String usePerson) { + this.usePerson = usePerson; + } + + public String getUsePersonName() { + return usePersonName; + } + + public void setUsePersonName(String usePersonName) { + this.usePersonName = usePersonName; + } + + public String getValidDate() { + return validDate; + } + + public void setValidDate(String validDate) { + this.validDate = validDate; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getWeight() { + return weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } + } + } +} diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt index c4eb16d..cb371ab 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt @@ -282,6 +282,26 @@ suspend fun getRemindEquipmentCount(@Header("token") token: String): String /** + * 获取到期设备列表 + */ + @POST("/meter/assets/remindListPage") + suspend fun getRemindEquipmentList( + @Header("token") token: String, + @Body requestBody: RequestBody, + @QueryMap limit: Map, + @QueryMap offset: Map + ): String + + /** + * 催办设备 + */ + @POST("/meter/assets/remindWorker") + suspend fun remindEquipment( + @Header("token") token: String, + @Body requestBody: RequestBody + ): String + + /** * 获取到期仪器数 */ @GET("/meter/standard/remindQuantity") diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt index 8b385fa..613e881 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt @@ -317,7 +317,6 @@ offset: Int ): String { val param = JsonObject() - param.addProperty("sid", "username") param.addProperty("equipmentNo", equipmentNo) param.addProperty("equipmentName", equipmentName) param.addProperty("mesureType", mesureType) @@ -606,6 +605,84 @@ } /** + * 获取到期设备列表 + */ + suspend fun getRemindEquipmentList( + managerState: String, + abc: String, + mesureType: String, + isCalibrationTestEquipment: String, + equipmentCategory: String, + useDept: String, + equipmentNo: String, + modelNo: String, + assetNo: String, + assetType: String, + isFixedAssets: String, + equipmentSpecifications: String, + labelId: String, + usePerson: String, + ids: Array, + equipmentName: String, + id: String, + validDateStart: String, + isStandardSupportEquipment: String, + isMeasureAccount: String, + manufacturingNo: String, + validDateEnd: String, + offset: Int + ): String { + val param = JsonObject() + param.addProperty("managerState", managerState) + param.addProperty("abc", abc) + param.addProperty("mesureType", mesureType) + param.addProperty("isCalibrationTestEquipment", isCalibrationTestEquipment) + param.addProperty("equipmentCategory", equipmentCategory) + param.addProperty("useDept", useDept) + param.addProperty("equipmentNo", equipmentNo) + param.addProperty("modelNo", modelNo) + param.addProperty("assetNo", assetNo) + param.addProperty("assetType", assetType) + param.addProperty("isFixedAssets", isFixedAssets) + param.addProperty("equipmentSpecifications", equipmentSpecifications) + param.addProperty("labelId", labelId) + param.addProperty("usePerson", usePerson) + param.add("ids", gson.toJsonTree(ids, typeToken).asJsonArray) + param.addProperty("equipmentName", equipmentName) + param.addProperty("id", id) + param.addProperty("validDateStart", validDateStart) + param.addProperty("isStandardSupportEquipment", isStandardSupportEquipment) + param.addProperty("isMeasureAccount", isMeasureAccount) + param.addProperty("manufacturingNo", manufacturingNo) + param.addProperty("validDateEnd", validDateEnd) + + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + + val limitMap = HashMap() + limitMap["limit"] = LocaleConstant.PAGE_LIMIT + + val offsetMap = HashMap() + offsetMap["offset"] = offset + return api.getRemindEquipmentList( + AuthenticationHelper.token!!, requestBody, limitMap, offsetMap + ) + } + + /** + * 催办设备 + */ + suspend fun remindEquipment(id: String): String { + val param = JsonObject() + param.addProperty("id", id) + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + return api.remindEquipment(AuthenticationHelper.token!!, requestBody) + } + + /** * 获取到期仪器数 */ suspend fun getRemindDeviceCount(): String { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt index 9fa4040..2d0126a 100644 --- a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt +++ b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt @@ -130,12 +130,14 @@ override fun initEvent() { leftBackView.setOnClickListener { finish() } + //设备 equipOvertimeLayout.setOnClickListener { - + navigatePageTo() } + //装置 deviceOvertimeLayout.setOnClickListener { - + navigatePageTo() } workTimeLayout.setOnClickListener { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt new file mode 100644 index 0000000..35a5837 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt @@ -0,0 +1,4 @@ +package com.casic.xz.meterage.view.home + +class OvertimeDeviceActivity { +} \ No newline at end of file diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt new file mode 100644 index 0000000..717e6b2 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt @@ -0,0 +1,264 @@ +package com.casic.xz.meterage.view.home + +import android.content.Context +import android.os.Handler +import androidx.lifecycle.ViewModelProvider +import androidx.recyclerview.widget.DividerItemDecoration +import com.casic.xz.meterage.R +import com.casic.xz.meterage.base.ApplicationBaseActivity +import com.casic.xz.meterage.extensions.formatToYearMonthDay +import com.casic.xz.meterage.extensions.initLayoutImmersionBar +import com.casic.xz.meterage.extensions.isEarlierThenCurrent +import com.casic.xz.meterage.extensions.showEmptyPage +import com.casic.xz.meterage.model.RemindEquipmentListModel +import com.casic.xz.meterage.utils.LoadingDialogHub +import com.casic.xz.meterage.vm.EquipmentViewModel +import com.gyf.immersionbar.ImmersionBar +import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter +import com.pengxh.kt.lite.adapter.ViewHolder +import com.pengxh.kt.lite.extensions.convertColor +import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.extensions.show +import com.pengxh.kt.lite.utils.WeakReferenceHandler +import com.pengxh.kt.lite.vm.LoadState +import com.pengxh.kt.lite.widget.dialog.AlertControlDialog +import kotlinx.android.synthetic.main.activity_overtime_equip.* +import kotlinx.android.synthetic.main.include_empty_view.* +import kotlinx.android.synthetic.main.include_search_title.* + +class OvertimeEquipActivity : ApplicationBaseActivity() { + + private var context: Context = this@OvertimeEquipActivity + private lateinit var weakReferenceHandler: WeakReferenceHandler + private lateinit var equipmentViewModel: EquipmentViewModel + private lateinit var equipmentAdapter: NormalRecyclerAdapter + private var dataBeans: MutableList = ArrayList() + private var pageIndex = 1 + private var isRefresh = false + private var isLoadMore = false + private var clickedPosition = 0 + + override fun initLayoutView(): Int = R.layout.activity_overtime_equip + + override fun setupTopBarLayout() { + ImmersionBar.with(this).statusBarDarkFont(true).init() + initLayoutImmersionBar(rootView) + titleView.text = "设备到期列表" + } + + override fun initData() { + weakReferenceHandler = WeakReferenceHandler(callback) + equipmentViewModel = ViewModelProvider(this)[EquipmentViewModel::class.java] + equipmentViewModel.remindEquipmentList.observe(this) { + if (it.code == 200) { + val dataRows = it.data?.rows!! + when { + isRefresh -> { + dataBeans.clear() + dataBeans = dataRows + equipmentLayout.finishRefresh() + isRefresh = false + } + isLoadMore -> { + if (dataRows.size == 0) { + "到底了,别拉了".show(this) + } + dataBeans.addAll(dataRows) + equipmentLayout.finishLoadMore() + isLoadMore = false + } + else -> { + dataBeans = dataRows + } + } + weakReferenceHandler.sendEmptyMessage(2023041801) + } + } + + equipmentViewModel.remindEquipmentResult.observe(this) { + if (it.code == 200) { + //催办之后列表虽然刷新,但是列表依旧存在,只有在对方处理了过期设备,列表还是刷新 + "操作成功".show(this) + } + } + } + + override fun observeRequestState() { + equipmentViewModel.loadState.observe(this) { + when (it) { + LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中...") + else -> LoadingDialogHub.dismiss() + } + } + } + + override fun initEvent() { + leftBackView.setOnClickListener { finish() } + + equipmentLayout.setOnRefreshListener { + isRefresh = true + //刷新之后页码重置 + pageIndex = 1 + getRemindEquipmentListByPage() + } + + equipmentLayout.setOnLoadMoreListener { + isLoadMore = true + pageIndex++ + getRemindEquipmentListByPage() + } + } + + override fun onResume() { + super.onResume() + pageIndex = 1 + getRemindEquipmentListByPage() + } + + private fun getRemindEquipmentListByPage() { + equipmentViewModel.getRemindEquipmentList( + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + arrayOf(), + "", + "", + "", + "", + "", + "", + "", + pageIndex + ) + } + + private val callback = Handler.Callback { + when (it.what) { + 2023041801 -> { + if (isRefresh || isLoadMore) { + equipmentAdapter.notifyDataSetChanged() + } else { + if (dataBeans.size == 0) { + emptyView!!.showEmptyPage("无过期设备") { + pageIndex = 1 + getRemindEquipmentListByPage() + } + } else { + emptyView!!.hide() + equipmentAdapter = object : + NormalRecyclerAdapter( + R.layout.item_remind_equipment_rv_l, dataBeans + ) { + override fun convertView( + viewHolder: ViewHolder, + position: Int, + item: RemindEquipmentListModel.DataModel.RowsModel + ) { + val modelNo = if (item.modelNo.isNullOrBlank()) { + "未知" + } else { + item.modelNo + } + + val remark = if (item.remark.isNullOrBlank()) { + "无" + } else { + item.remark + } + + val useDept = if (item.useDeptName.isNullOrBlank()) { + "未知" + } else { + item.useDeptName + } + + val usePerson = if (item.usePersonName.isNullOrBlank()) { + "无" + } else { + item.usePersonName + } + + if (item.validDate.isEarlierThenCurrent()) { + viewHolder.setTextColor( + R.id.deviceDateView, R.color.red.convertColor(context) + ) + } else { + viewHolder.setTextColor( + R.id.deviceDateView, R.color.gray.convertColor(context) + ) + } + + viewHolder.setText(R.id.equipmentName, item.equipmentName) + .setText(R.id.modelView, modelNo) + .setText(R.id.equipmentStateView, item.managerStateName) + .setText(R.id.equipmentCodeView, "装置编号:${item.equipmentNo}") + .setText(R.id.remarkView, "备注:$remark") + .setText(R.id.useDeptView, useDept) + .setText( + R.id.deviceDateView, + "有效期至:${item.validDate.formatToYearMonthDay()}" + ) + .setText(R.id.usePersonView, "管理员:$usePerson") + + if (!item.managerStateName.contains("在用")) { + viewHolder.setBackgroundColor( + R.id.equipmentStateView, R.color.gray.convertColor(context) + ) + } + + viewHolder.setOnClickListener(R.id.remindButton) { + //标记被点击的item位置 + clickedPosition = position + AlertControlDialog.Builder() + .setContext(context) + .setTitle("提示") + .setMessage("确定催办该设备?") + .setNegativeButton("取消") + .setPositiveButton("确定") + .setOnDialogButtonClickListener(object : + AlertControlDialog.OnDialogButtonClickListener { + override fun onCancelClick() { + + } + + override fun onConfirmClick() { + if (item.id.isBlank()) { + "设备ID异常,无法催办".show(context) + return + } + equipmentViewModel.remindEquipment(item.id) + } + }).build().show() + } + } + } + equipmentRecyclerView.addItemDecoration( + DividerItemDecoration(this, DividerItemDecoration.VERTICAL) + ) + equipmentRecyclerView.adapter = equipmentAdapter + equipmentAdapter.setOnItemClickedListener(object : + NormalRecyclerAdapter.OnItemClickedListener { + override fun onItemClicked( + position: Int, t: RemindEquipmentListModel.DataModel.RowsModel + ) { + navigatePageTo(t.id) + } + }) + } + } + } + } + true + } +} \ No newline at end of file diff --git a/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt b/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt index 076ac4c..b1817bc 100644 --- a/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt +++ b/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt @@ -28,6 +28,8 @@ val stateChangeResult = MutableLiveData() val usageRecordResult = MutableLiveData() val remindEquipmentCount = MutableLiveData() + val remindEquipmentList = MutableLiveData() + val remindEquipmentResult = MutableLiveData() val remindDeviceCount = MutableLiveData() fun getEquipmentList( @@ -230,6 +232,88 @@ it.printStackTrace() }) + fun getRemindEquipmentList( + managerState: String, + abc: String, + mesureType: String, + isCalibrationTestEquipment: String, + equipmentCategory: String, + useDept: String, + equipmentNo: String, + modelNo: String, + assetNo: String, + assetType: String, + isFixedAssets: String, + equipmentSpecifications: String, + labelId: String, + usePerson: String, + ids: Array, + equipmentName: String, + id: String, + validDateStart: String, + isStandardSupportEquipment: String, + isMeasureAccount: String, + manufacturingNo: String, + validDateEnd: String, + offset: Int + ) = launch({ + loadState.value = LoadState.Loading + val response = RetrofitServiceManager.getRemindEquipmentList( + managerState, + abc, + mesureType, + isCalibrationTestEquipment, + equipmentCategory, + useDept, + equipmentNo, + modelNo, + assetNo, + assetType, + isFixedAssets, + equipmentSpecifications, + labelId, + usePerson, + ids, + equipmentName, + id, + validDateStart, + isStandardSupportEquipment, + isMeasureAccount, + manufacturingNo, + validDateEnd, + offset + ) + val responseCode = response.separateResponseCode() + if (responseCode == 200) { + loadState.value = LoadState.Success + remindEquipmentList.value = gson.fromJson( + response, object : TypeToken() {}.type + ) + } else { + loadState.value = LoadState.Fail + response.toErrorMessage().show(BaseApplication.get()) + } + }, { + loadState.value = LoadState.Fail + it.cause.toString().show(BaseApplication.get()) + it.printStackTrace() + }) + + fun remindEquipment(id: String) = launch({ + val response = RetrofitServiceManager.remindEquipment(id) + val responseCode = response.separateResponseCode() + if (responseCode == 200) { + remindEquipmentResult.value = gson.fromJson( + response, object : TypeToken() {}.type + ) + } else { + response.toErrorMessage().show(BaseApplication.get()) + } + }, { + it.cause.toString().show(BaseApplication.get()) + it.printStackTrace() + }) + fun getRemindDeviceCount() = launch({ val response = RetrofitServiceManager.getRemindDeviceCount() val responseCode = response.separateResponseCode() diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95f17d4..9bc098c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,6 +75,7 @@ + diff --git a/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java new file mode 100644 index 0000000..4f51e23 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java @@ -0,0 +1,724 @@ +package com.casic.xz.meterage.model; + +import java.util.List; + +public class RemindEquipmentListModel { + + private int code; + private DataModel data; + private String message; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataModel getData() { + return data; + } + + public void setData(DataModel data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static class DataModel { + private List rows; + private int total; + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public static class RowsModel { + private String abc; + private String abcName; + private String applyRelationId; + private String assetNo; + private String assetSource; + private String assetType; + private String assetTypeName; + private String attribute; + private String capitalSource; + private String capitalSourceName; + private String cardEstablishmentDate; + private String compulsoryVerification; + private String createTime; + private String createUser; + private String depreciationMethod; + private String depreciationMethodName; + private String depreciationPeriod; + private String enableDate; + private String equipmentCategory; + private String equipmentCategoryName; + private String equipmentName; + private String equipmentNo; + private String equipmentSpecifications; + private String equipmentType; + private String equipmentTypeName; + private String fileList; + private String id; + private String installIncidentalExpenses; + private String installPlace; + private String intactState; + private String isCalibrationTestEquipment; + private String isDel; + private String isFixedAssets; + private String isMeasureAccount; + private String isStandardSupportEquipment; + private String labelBind; + private String majorCategory; + private String majorCategoryName; + private String managerLevel; + private String managerLevelName; + private String managerState; + private String managerStateName; + private String manufacturer; + private String manufacturerCountry; + private String manufacturingDate; + private String manufacturingNo; + private String mesureCycle; + private String mesureDate; + private String mesureDept; + private String mesureDeptName; + private String mesureRange; + private String mesureResult; + private String mesureResultName; + private String mesureType; + private String mesureTypeName; + private String modelNo; + private String originValue; + private String overallDimension; + private String presentOriginValue; + private String purpose; + private String remark; + private String singlePrice; + private String supportStandardEquipmentName; + private String supportStandardEquipmentNo; + private String technicalLevel; + private String uncertainty; + private String updateTime; + private String useDept; + private String useDeptName; + private String usePerson; + private String usePersonName; + private String validDate; + private String version; + private String weight; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public String getAbcName() { + return abcName; + } + + public void setAbcName(String abcName) { + this.abcName = abcName; + } + + public String getApplyRelationId() { + return applyRelationId; + } + + public void setApplyRelationId(String applyRelationId) { + this.applyRelationId = applyRelationId; + } + + public String getAssetNo() { + return assetNo; + } + + public void setAssetNo(String assetNo) { + this.assetNo = assetNo; + } + + public String getAssetSource() { + return assetSource; + } + + public void setAssetSource(String assetSource) { + this.assetSource = assetSource; + } + + public String getAssetType() { + return assetType; + } + + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + public String getAssetTypeName() { + return assetTypeName; + } + + public void setAssetTypeName(String assetTypeName) { + this.assetTypeName = assetTypeName; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getCapitalSource() { + return capitalSource; + } + + public void setCapitalSource(String capitalSource) { + this.capitalSource = capitalSource; + } + + public String getCapitalSourceName() { + return capitalSourceName; + } + + public void setCapitalSourceName(String capitalSourceName) { + this.capitalSourceName = capitalSourceName; + } + + public String getCardEstablishmentDate() { + return cardEstablishmentDate; + } + + public void setCardEstablishmentDate(String cardEstablishmentDate) { + this.cardEstablishmentDate = cardEstablishmentDate; + } + + public String getCompulsoryVerification() { + return compulsoryVerification; + } + + public void setCompulsoryVerification(String compulsoryVerification) { + this.compulsoryVerification = compulsoryVerification; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getDepreciationMethod() { + return depreciationMethod; + } + + public void setDepreciationMethod(String depreciationMethod) { + this.depreciationMethod = depreciationMethod; + } + + public String getDepreciationMethodName() { + return depreciationMethodName; + } + + public void setDepreciationMethodName(String depreciationMethodName) { + this.depreciationMethodName = depreciationMethodName; + } + + public String getDepreciationPeriod() { + return depreciationPeriod; + } + + public void setDepreciationPeriod(String depreciationPeriod) { + this.depreciationPeriod = depreciationPeriod; + } + + public String getEnableDate() { + return enableDate; + } + + public void setEnableDate(String enableDate) { + this.enableDate = enableDate; + } + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + + public String getEquipmentCategoryName() { + return equipmentCategoryName; + } + + public void setEquipmentCategoryName(String equipmentCategoryName) { + this.equipmentCategoryName = equipmentCategoryName; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentNo() { + return equipmentNo; + } + + public void setEquipmentNo(String equipmentNo) { + this.equipmentNo = equipmentNo; + } + + public String getEquipmentSpecifications() { + return equipmentSpecifications; + } + + public void setEquipmentSpecifications(String equipmentSpecifications) { + this.equipmentSpecifications = equipmentSpecifications; + } + + public String getEquipmentType() { + return equipmentType; + } + + public void setEquipmentType(String equipmentType) { + this.equipmentType = equipmentType; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getFileList() { + return fileList; + } + + public void setFileList(String fileList) { + this.fileList = fileList; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInstallIncidentalExpenses() { + return installIncidentalExpenses; + } + + public void setInstallIncidentalExpenses(String installIncidentalExpenses) { + this.installIncidentalExpenses = installIncidentalExpenses; + } + + public String getInstallPlace() { + return installPlace; + } + + public void setInstallPlace(String installPlace) { + this.installPlace = installPlace; + } + + public String getIntactState() { + return intactState; + } + + public void setIntactState(String intactState) { + this.intactState = intactState; + } + + public String getIsCalibrationTestEquipment() { + return isCalibrationTestEquipment; + } + + public void setIsCalibrationTestEquipment(String isCalibrationTestEquipment) { + this.isCalibrationTestEquipment = isCalibrationTestEquipment; + } + + public String getIsDel() { + return isDel; + } + + public void setIsDel(String isDel) { + this.isDel = isDel; + } + + public String getIsFixedAssets() { + return isFixedAssets; + } + + public void setIsFixedAssets(String isFixedAssets) { + this.isFixedAssets = isFixedAssets; + } + + public String getIsMeasureAccount() { + return isMeasureAccount; + } + + public void setIsMeasureAccount(String isMeasureAccount) { + this.isMeasureAccount = isMeasureAccount; + } + + public String getIsStandardSupportEquipment() { + return isStandardSupportEquipment; + } + + public void setIsStandardSupportEquipment(String isStandardSupportEquipment) { + this.isStandardSupportEquipment = isStandardSupportEquipment; + } + + public String getLabelBind() { + return labelBind; + } + + public void setLabelBind(String labelBind) { + this.labelBind = labelBind; + } + + public String getMajorCategory() { + return majorCategory; + } + + public void setMajorCategory(String majorCategory) { + this.majorCategory = majorCategory; + } + + public String getMajorCategoryName() { + return majorCategoryName; + } + + public void setMajorCategoryName(String majorCategoryName) { + this.majorCategoryName = majorCategoryName; + } + + public String getManagerLevel() { + return managerLevel; + } + + public void setManagerLevel(String managerLevel) { + this.managerLevel = managerLevel; + } + + public String getManagerLevelName() { + return managerLevelName; + } + + public void setManagerLevelName(String managerLevelName) { + this.managerLevelName = managerLevelName; + } + + public String getManagerState() { + return managerState; + } + + public void setManagerState(String managerState) { + this.managerState = managerState; + } + + public String getManagerStateName() { + return managerStateName; + } + + public void setManagerStateName(String managerStateName) { + this.managerStateName = managerStateName; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturerCountry() { + return manufacturerCountry; + } + + public void setManufacturerCountry(String manufacturerCountry) { + this.manufacturerCountry = manufacturerCountry; + } + + public String getManufacturingDate() { + return manufacturingDate; + } + + public void setManufacturingDate(String manufacturingDate) { + this.manufacturingDate = manufacturingDate; + } + + public String getManufacturingNo() { + return manufacturingNo; + } + + public void setManufacturingNo(String manufacturingNo) { + this.manufacturingNo = manufacturingNo; + } + + public String getMesureCycle() { + return mesureCycle; + } + + public void setMesureCycle(String mesureCycle) { + this.mesureCycle = mesureCycle; + } + + public String getMesureDate() { + return mesureDate; + } + + public void setMesureDate(String mesureDate) { + this.mesureDate = mesureDate; + } + + public String getMesureDept() { + return mesureDept; + } + + public void setMesureDept(String mesureDept) { + this.mesureDept = mesureDept; + } + + public String getMesureDeptName() { + return mesureDeptName; + } + + public void setMesureDeptName(String mesureDeptName) { + this.mesureDeptName = mesureDeptName; + } + + public String getMesureRange() { + return mesureRange; + } + + public void setMesureRange(String mesureRange) { + this.mesureRange = mesureRange; + } + + public String getMesureResult() { + return mesureResult; + } + + public void setMesureResult(String mesureResult) { + this.mesureResult = mesureResult; + } + + public String getMesureResultName() { + return mesureResultName; + } + + public void setMesureResultName(String mesureResultName) { + this.mesureResultName = mesureResultName; + } + + public String getMesureType() { + return mesureType; + } + + public void setMesureType(String mesureType) { + this.mesureType = mesureType; + } + + public String getMesureTypeName() { + return mesureTypeName; + } + + public void setMesureTypeName(String mesureTypeName) { + this.mesureTypeName = mesureTypeName; + } + + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getOriginValue() { + return originValue; + } + + public void setOriginValue(String originValue) { + this.originValue = originValue; + } + + public String getOverallDimension() { + return overallDimension; + } + + public void setOverallDimension(String overallDimension) { + this.overallDimension = overallDimension; + } + + public String getPresentOriginValue() { + return presentOriginValue; + } + + public void setPresentOriginValue(String presentOriginValue) { + this.presentOriginValue = presentOriginValue; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getSinglePrice() { + return singlePrice; + } + + public void setSinglePrice(String singlePrice) { + this.singlePrice = singlePrice; + } + + public String getSupportStandardEquipmentName() { + return supportStandardEquipmentName; + } + + public void setSupportStandardEquipmentName(String supportStandardEquipmentName) { + this.supportStandardEquipmentName = supportStandardEquipmentName; + } + + public String getSupportStandardEquipmentNo() { + return supportStandardEquipmentNo; + } + + public void setSupportStandardEquipmentNo(String supportStandardEquipmentNo) { + this.supportStandardEquipmentNo = supportStandardEquipmentNo; + } + + public String getTechnicalLevel() { + return technicalLevel; + } + + public void setTechnicalLevel(String technicalLevel) { + this.technicalLevel = technicalLevel; + } + + public String getUncertainty() { + return uncertainty; + } + + public void setUncertainty(String uncertainty) { + this.uncertainty = uncertainty; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getUseDept() { + return useDept; + } + + public void setUseDept(String useDept) { + this.useDept = useDept; + } + + public String getUseDeptName() { + return useDeptName; + } + + public void setUseDeptName(String useDeptName) { + this.useDeptName = useDeptName; + } + + public String getUsePerson() { + return usePerson; + } + + public void setUsePerson(String usePerson) { + this.usePerson = usePerson; + } + + public String getUsePersonName() { + return usePersonName; + } + + public void setUsePersonName(String usePersonName) { + this.usePersonName = usePersonName; + } + + public String getValidDate() { + return validDate; + } + + public void setValidDate(String validDate) { + this.validDate = validDate; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getWeight() { + return weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } + } + } +} diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt index c4eb16d..cb371ab 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt @@ -282,6 +282,26 @@ suspend fun getRemindEquipmentCount(@Header("token") token: String): String /** + * 获取到期设备列表 + */ + @POST("/meter/assets/remindListPage") + suspend fun getRemindEquipmentList( + @Header("token") token: String, + @Body requestBody: RequestBody, + @QueryMap limit: Map, + @QueryMap offset: Map + ): String + + /** + * 催办设备 + */ + @POST("/meter/assets/remindWorker") + suspend fun remindEquipment( + @Header("token") token: String, + @Body requestBody: RequestBody + ): String + + /** * 获取到期仪器数 */ @GET("/meter/standard/remindQuantity") diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt index 8b385fa..613e881 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt @@ -317,7 +317,6 @@ offset: Int ): String { val param = JsonObject() - param.addProperty("sid", "username") param.addProperty("equipmentNo", equipmentNo) param.addProperty("equipmentName", equipmentName) param.addProperty("mesureType", mesureType) @@ -606,6 +605,84 @@ } /** + * 获取到期设备列表 + */ + suspend fun getRemindEquipmentList( + managerState: String, + abc: String, + mesureType: String, + isCalibrationTestEquipment: String, + equipmentCategory: String, + useDept: String, + equipmentNo: String, + modelNo: String, + assetNo: String, + assetType: String, + isFixedAssets: String, + equipmentSpecifications: String, + labelId: String, + usePerson: String, + ids: Array, + equipmentName: String, + id: String, + validDateStart: String, + isStandardSupportEquipment: String, + isMeasureAccount: String, + manufacturingNo: String, + validDateEnd: String, + offset: Int + ): String { + val param = JsonObject() + param.addProperty("managerState", managerState) + param.addProperty("abc", abc) + param.addProperty("mesureType", mesureType) + param.addProperty("isCalibrationTestEquipment", isCalibrationTestEquipment) + param.addProperty("equipmentCategory", equipmentCategory) + param.addProperty("useDept", useDept) + param.addProperty("equipmentNo", equipmentNo) + param.addProperty("modelNo", modelNo) + param.addProperty("assetNo", assetNo) + param.addProperty("assetType", assetType) + param.addProperty("isFixedAssets", isFixedAssets) + param.addProperty("equipmentSpecifications", equipmentSpecifications) + param.addProperty("labelId", labelId) + param.addProperty("usePerson", usePerson) + param.add("ids", gson.toJsonTree(ids, typeToken).asJsonArray) + param.addProperty("equipmentName", equipmentName) + param.addProperty("id", id) + param.addProperty("validDateStart", validDateStart) + param.addProperty("isStandardSupportEquipment", isStandardSupportEquipment) + param.addProperty("isMeasureAccount", isMeasureAccount) + param.addProperty("manufacturingNo", manufacturingNo) + param.addProperty("validDateEnd", validDateEnd) + + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + + val limitMap = HashMap() + limitMap["limit"] = LocaleConstant.PAGE_LIMIT + + val offsetMap = HashMap() + offsetMap["offset"] = offset + return api.getRemindEquipmentList( + AuthenticationHelper.token!!, requestBody, limitMap, offsetMap + ) + } + + /** + * 催办设备 + */ + suspend fun remindEquipment(id: String): String { + val param = JsonObject() + param.addProperty("id", id) + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + return api.remindEquipment(AuthenticationHelper.token!!, requestBody) + } + + /** * 获取到期仪器数 */ suspend fun getRemindDeviceCount(): String { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt index 9fa4040..2d0126a 100644 --- a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt +++ b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt @@ -130,12 +130,14 @@ override fun initEvent() { leftBackView.setOnClickListener { finish() } + //设备 equipOvertimeLayout.setOnClickListener { - + navigatePageTo() } + //装置 deviceOvertimeLayout.setOnClickListener { - + navigatePageTo() } workTimeLayout.setOnClickListener { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt new file mode 100644 index 0000000..35a5837 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt @@ -0,0 +1,4 @@ +package com.casic.xz.meterage.view.home + +class OvertimeDeviceActivity { +} \ No newline at end of file diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt new file mode 100644 index 0000000..717e6b2 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt @@ -0,0 +1,264 @@ +package com.casic.xz.meterage.view.home + +import android.content.Context +import android.os.Handler +import androidx.lifecycle.ViewModelProvider +import androidx.recyclerview.widget.DividerItemDecoration +import com.casic.xz.meterage.R +import com.casic.xz.meterage.base.ApplicationBaseActivity +import com.casic.xz.meterage.extensions.formatToYearMonthDay +import com.casic.xz.meterage.extensions.initLayoutImmersionBar +import com.casic.xz.meterage.extensions.isEarlierThenCurrent +import com.casic.xz.meterage.extensions.showEmptyPage +import com.casic.xz.meterage.model.RemindEquipmentListModel +import com.casic.xz.meterage.utils.LoadingDialogHub +import com.casic.xz.meterage.vm.EquipmentViewModel +import com.gyf.immersionbar.ImmersionBar +import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter +import com.pengxh.kt.lite.adapter.ViewHolder +import com.pengxh.kt.lite.extensions.convertColor +import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.extensions.show +import com.pengxh.kt.lite.utils.WeakReferenceHandler +import com.pengxh.kt.lite.vm.LoadState +import com.pengxh.kt.lite.widget.dialog.AlertControlDialog +import kotlinx.android.synthetic.main.activity_overtime_equip.* +import kotlinx.android.synthetic.main.include_empty_view.* +import kotlinx.android.synthetic.main.include_search_title.* + +class OvertimeEquipActivity : ApplicationBaseActivity() { + + private var context: Context = this@OvertimeEquipActivity + private lateinit var weakReferenceHandler: WeakReferenceHandler + private lateinit var equipmentViewModel: EquipmentViewModel + private lateinit var equipmentAdapter: NormalRecyclerAdapter + private var dataBeans: MutableList = ArrayList() + private var pageIndex = 1 + private var isRefresh = false + private var isLoadMore = false + private var clickedPosition = 0 + + override fun initLayoutView(): Int = R.layout.activity_overtime_equip + + override fun setupTopBarLayout() { + ImmersionBar.with(this).statusBarDarkFont(true).init() + initLayoutImmersionBar(rootView) + titleView.text = "设备到期列表" + } + + override fun initData() { + weakReferenceHandler = WeakReferenceHandler(callback) + equipmentViewModel = ViewModelProvider(this)[EquipmentViewModel::class.java] + equipmentViewModel.remindEquipmentList.observe(this) { + if (it.code == 200) { + val dataRows = it.data?.rows!! + when { + isRefresh -> { + dataBeans.clear() + dataBeans = dataRows + equipmentLayout.finishRefresh() + isRefresh = false + } + isLoadMore -> { + if (dataRows.size == 0) { + "到底了,别拉了".show(this) + } + dataBeans.addAll(dataRows) + equipmentLayout.finishLoadMore() + isLoadMore = false + } + else -> { + dataBeans = dataRows + } + } + weakReferenceHandler.sendEmptyMessage(2023041801) + } + } + + equipmentViewModel.remindEquipmentResult.observe(this) { + if (it.code == 200) { + //催办之后列表虽然刷新,但是列表依旧存在,只有在对方处理了过期设备,列表还是刷新 + "操作成功".show(this) + } + } + } + + override fun observeRequestState() { + equipmentViewModel.loadState.observe(this) { + when (it) { + LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中...") + else -> LoadingDialogHub.dismiss() + } + } + } + + override fun initEvent() { + leftBackView.setOnClickListener { finish() } + + equipmentLayout.setOnRefreshListener { + isRefresh = true + //刷新之后页码重置 + pageIndex = 1 + getRemindEquipmentListByPage() + } + + equipmentLayout.setOnLoadMoreListener { + isLoadMore = true + pageIndex++ + getRemindEquipmentListByPage() + } + } + + override fun onResume() { + super.onResume() + pageIndex = 1 + getRemindEquipmentListByPage() + } + + private fun getRemindEquipmentListByPage() { + equipmentViewModel.getRemindEquipmentList( + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + arrayOf(), + "", + "", + "", + "", + "", + "", + "", + pageIndex + ) + } + + private val callback = Handler.Callback { + when (it.what) { + 2023041801 -> { + if (isRefresh || isLoadMore) { + equipmentAdapter.notifyDataSetChanged() + } else { + if (dataBeans.size == 0) { + emptyView!!.showEmptyPage("无过期设备") { + pageIndex = 1 + getRemindEquipmentListByPage() + } + } else { + emptyView!!.hide() + equipmentAdapter = object : + NormalRecyclerAdapter( + R.layout.item_remind_equipment_rv_l, dataBeans + ) { + override fun convertView( + viewHolder: ViewHolder, + position: Int, + item: RemindEquipmentListModel.DataModel.RowsModel + ) { + val modelNo = if (item.modelNo.isNullOrBlank()) { + "未知" + } else { + item.modelNo + } + + val remark = if (item.remark.isNullOrBlank()) { + "无" + } else { + item.remark + } + + val useDept = if (item.useDeptName.isNullOrBlank()) { + "未知" + } else { + item.useDeptName + } + + val usePerson = if (item.usePersonName.isNullOrBlank()) { + "无" + } else { + item.usePersonName + } + + if (item.validDate.isEarlierThenCurrent()) { + viewHolder.setTextColor( + R.id.deviceDateView, R.color.red.convertColor(context) + ) + } else { + viewHolder.setTextColor( + R.id.deviceDateView, R.color.gray.convertColor(context) + ) + } + + viewHolder.setText(R.id.equipmentName, item.equipmentName) + .setText(R.id.modelView, modelNo) + .setText(R.id.equipmentStateView, item.managerStateName) + .setText(R.id.equipmentCodeView, "装置编号:${item.equipmentNo}") + .setText(R.id.remarkView, "备注:$remark") + .setText(R.id.useDeptView, useDept) + .setText( + R.id.deviceDateView, + "有效期至:${item.validDate.formatToYearMonthDay()}" + ) + .setText(R.id.usePersonView, "管理员:$usePerson") + + if (!item.managerStateName.contains("在用")) { + viewHolder.setBackgroundColor( + R.id.equipmentStateView, R.color.gray.convertColor(context) + ) + } + + viewHolder.setOnClickListener(R.id.remindButton) { + //标记被点击的item位置 + clickedPosition = position + AlertControlDialog.Builder() + .setContext(context) + .setTitle("提示") + .setMessage("确定催办该设备?") + .setNegativeButton("取消") + .setPositiveButton("确定") + .setOnDialogButtonClickListener(object : + AlertControlDialog.OnDialogButtonClickListener { + override fun onCancelClick() { + + } + + override fun onConfirmClick() { + if (item.id.isBlank()) { + "设备ID异常,无法催办".show(context) + return + } + equipmentViewModel.remindEquipment(item.id) + } + }).build().show() + } + } + } + equipmentRecyclerView.addItemDecoration( + DividerItemDecoration(this, DividerItemDecoration.VERTICAL) + ) + equipmentRecyclerView.adapter = equipmentAdapter + equipmentAdapter.setOnItemClickedListener(object : + NormalRecyclerAdapter.OnItemClickedListener { + override fun onItemClicked( + position: Int, t: RemindEquipmentListModel.DataModel.RowsModel + ) { + navigatePageTo(t.id) + } + }) + } + } + } + } + true + } +} \ No newline at end of file diff --git a/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt b/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt index 076ac4c..b1817bc 100644 --- a/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt +++ b/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt @@ -28,6 +28,8 @@ val stateChangeResult = MutableLiveData() val usageRecordResult = MutableLiveData() val remindEquipmentCount = MutableLiveData() + val remindEquipmentList = MutableLiveData() + val remindEquipmentResult = MutableLiveData() val remindDeviceCount = MutableLiveData() fun getEquipmentList( @@ -230,6 +232,88 @@ it.printStackTrace() }) + fun getRemindEquipmentList( + managerState: String, + abc: String, + mesureType: String, + isCalibrationTestEquipment: String, + equipmentCategory: String, + useDept: String, + equipmentNo: String, + modelNo: String, + assetNo: String, + assetType: String, + isFixedAssets: String, + equipmentSpecifications: String, + labelId: String, + usePerson: String, + ids: Array, + equipmentName: String, + id: String, + validDateStart: String, + isStandardSupportEquipment: String, + isMeasureAccount: String, + manufacturingNo: String, + validDateEnd: String, + offset: Int + ) = launch({ + loadState.value = LoadState.Loading + val response = RetrofitServiceManager.getRemindEquipmentList( + managerState, + abc, + mesureType, + isCalibrationTestEquipment, + equipmentCategory, + useDept, + equipmentNo, + modelNo, + assetNo, + assetType, + isFixedAssets, + equipmentSpecifications, + labelId, + usePerson, + ids, + equipmentName, + id, + validDateStart, + isStandardSupportEquipment, + isMeasureAccount, + manufacturingNo, + validDateEnd, + offset + ) + val responseCode = response.separateResponseCode() + if (responseCode == 200) { + loadState.value = LoadState.Success + remindEquipmentList.value = gson.fromJson( + response, object : TypeToken() {}.type + ) + } else { + loadState.value = LoadState.Fail + response.toErrorMessage().show(BaseApplication.get()) + } + }, { + loadState.value = LoadState.Fail + it.cause.toString().show(BaseApplication.get()) + it.printStackTrace() + }) + + fun remindEquipment(id: String) = launch({ + val response = RetrofitServiceManager.remindEquipment(id) + val responseCode = response.separateResponseCode() + if (responseCode == 200) { + remindEquipmentResult.value = gson.fromJson( + response, object : TypeToken() {}.type + ) + } else { + response.toErrorMessage().show(BaseApplication.get()) + } + }, { + it.cause.toString().show(BaseApplication.get()) + it.printStackTrace() + }) + fun getRemindDeviceCount() = launch({ val response = RetrofitServiceManager.getRemindDeviceCount() val responseCode = response.separateResponseCode() diff --git a/app/src/main/res/layout/activity_overtime_equip.xml b/app/src/main/res/layout/activity_overtime_equip.xml new file mode 100644 index 0000000..c8dc9b8 --- /dev/null +++ b/app/src/main/res/layout/activity_overtime_equip.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95f17d4..9bc098c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -75,6 +75,7 @@ + diff --git a/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java new file mode 100644 index 0000000..4f51e23 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/model/RemindEquipmentListModel.java @@ -0,0 +1,724 @@ +package com.casic.xz.meterage.model; + +import java.util.List; + +public class RemindEquipmentListModel { + + private int code; + private DataModel data; + private String message; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataModel getData() { + return data; + } + + public void setData(DataModel data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public static class DataModel { + private List rows; + private int total; + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public static class RowsModel { + private String abc; + private String abcName; + private String applyRelationId; + private String assetNo; + private String assetSource; + private String assetType; + private String assetTypeName; + private String attribute; + private String capitalSource; + private String capitalSourceName; + private String cardEstablishmentDate; + private String compulsoryVerification; + private String createTime; + private String createUser; + private String depreciationMethod; + private String depreciationMethodName; + private String depreciationPeriod; + private String enableDate; + private String equipmentCategory; + private String equipmentCategoryName; + private String equipmentName; + private String equipmentNo; + private String equipmentSpecifications; + private String equipmentType; + private String equipmentTypeName; + private String fileList; + private String id; + private String installIncidentalExpenses; + private String installPlace; + private String intactState; + private String isCalibrationTestEquipment; + private String isDel; + private String isFixedAssets; + private String isMeasureAccount; + private String isStandardSupportEquipment; + private String labelBind; + private String majorCategory; + private String majorCategoryName; + private String managerLevel; + private String managerLevelName; + private String managerState; + private String managerStateName; + private String manufacturer; + private String manufacturerCountry; + private String manufacturingDate; + private String manufacturingNo; + private String mesureCycle; + private String mesureDate; + private String mesureDept; + private String mesureDeptName; + private String mesureRange; + private String mesureResult; + private String mesureResultName; + private String mesureType; + private String mesureTypeName; + private String modelNo; + private String originValue; + private String overallDimension; + private String presentOriginValue; + private String purpose; + private String remark; + private String singlePrice; + private String supportStandardEquipmentName; + private String supportStandardEquipmentNo; + private String technicalLevel; + private String uncertainty; + private String updateTime; + private String useDept; + private String useDeptName; + private String usePerson; + private String usePersonName; + private String validDate; + private String version; + private String weight; + + public String getAbc() { + return abc; + } + + public void setAbc(String abc) { + this.abc = abc; + } + + public String getAbcName() { + return abcName; + } + + public void setAbcName(String abcName) { + this.abcName = abcName; + } + + public String getApplyRelationId() { + return applyRelationId; + } + + public void setApplyRelationId(String applyRelationId) { + this.applyRelationId = applyRelationId; + } + + public String getAssetNo() { + return assetNo; + } + + public void setAssetNo(String assetNo) { + this.assetNo = assetNo; + } + + public String getAssetSource() { + return assetSource; + } + + public void setAssetSource(String assetSource) { + this.assetSource = assetSource; + } + + public String getAssetType() { + return assetType; + } + + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + public String getAssetTypeName() { + return assetTypeName; + } + + public void setAssetTypeName(String assetTypeName) { + this.assetTypeName = assetTypeName; + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getCapitalSource() { + return capitalSource; + } + + public void setCapitalSource(String capitalSource) { + this.capitalSource = capitalSource; + } + + public String getCapitalSourceName() { + return capitalSourceName; + } + + public void setCapitalSourceName(String capitalSourceName) { + this.capitalSourceName = capitalSourceName; + } + + public String getCardEstablishmentDate() { + return cardEstablishmentDate; + } + + public void setCardEstablishmentDate(String cardEstablishmentDate) { + this.cardEstablishmentDate = cardEstablishmentDate; + } + + public String getCompulsoryVerification() { + return compulsoryVerification; + } + + public void setCompulsoryVerification(String compulsoryVerification) { + this.compulsoryVerification = compulsoryVerification; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public String getDepreciationMethod() { + return depreciationMethod; + } + + public void setDepreciationMethod(String depreciationMethod) { + this.depreciationMethod = depreciationMethod; + } + + public String getDepreciationMethodName() { + return depreciationMethodName; + } + + public void setDepreciationMethodName(String depreciationMethodName) { + this.depreciationMethodName = depreciationMethodName; + } + + public String getDepreciationPeriod() { + return depreciationPeriod; + } + + public void setDepreciationPeriod(String depreciationPeriod) { + this.depreciationPeriod = depreciationPeriod; + } + + public String getEnableDate() { + return enableDate; + } + + public void setEnableDate(String enableDate) { + this.enableDate = enableDate; + } + + public String getEquipmentCategory() { + return equipmentCategory; + } + + public void setEquipmentCategory(String equipmentCategory) { + this.equipmentCategory = equipmentCategory; + } + + public String getEquipmentCategoryName() { + return equipmentCategoryName; + } + + public void setEquipmentCategoryName(String equipmentCategoryName) { + this.equipmentCategoryName = equipmentCategoryName; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentNo() { + return equipmentNo; + } + + public void setEquipmentNo(String equipmentNo) { + this.equipmentNo = equipmentNo; + } + + public String getEquipmentSpecifications() { + return equipmentSpecifications; + } + + public void setEquipmentSpecifications(String equipmentSpecifications) { + this.equipmentSpecifications = equipmentSpecifications; + } + + public String getEquipmentType() { + return equipmentType; + } + + public void setEquipmentType(String equipmentType) { + this.equipmentType = equipmentType; + } + + public String getEquipmentTypeName() { + return equipmentTypeName; + } + + public void setEquipmentTypeName(String equipmentTypeName) { + this.equipmentTypeName = equipmentTypeName; + } + + public String getFileList() { + return fileList; + } + + public void setFileList(String fileList) { + this.fileList = fileList; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInstallIncidentalExpenses() { + return installIncidentalExpenses; + } + + public void setInstallIncidentalExpenses(String installIncidentalExpenses) { + this.installIncidentalExpenses = installIncidentalExpenses; + } + + public String getInstallPlace() { + return installPlace; + } + + public void setInstallPlace(String installPlace) { + this.installPlace = installPlace; + } + + public String getIntactState() { + return intactState; + } + + public void setIntactState(String intactState) { + this.intactState = intactState; + } + + public String getIsCalibrationTestEquipment() { + return isCalibrationTestEquipment; + } + + public void setIsCalibrationTestEquipment(String isCalibrationTestEquipment) { + this.isCalibrationTestEquipment = isCalibrationTestEquipment; + } + + public String getIsDel() { + return isDel; + } + + public void setIsDel(String isDel) { + this.isDel = isDel; + } + + public String getIsFixedAssets() { + return isFixedAssets; + } + + public void setIsFixedAssets(String isFixedAssets) { + this.isFixedAssets = isFixedAssets; + } + + public String getIsMeasureAccount() { + return isMeasureAccount; + } + + public void setIsMeasureAccount(String isMeasureAccount) { + this.isMeasureAccount = isMeasureAccount; + } + + public String getIsStandardSupportEquipment() { + return isStandardSupportEquipment; + } + + public void setIsStandardSupportEquipment(String isStandardSupportEquipment) { + this.isStandardSupportEquipment = isStandardSupportEquipment; + } + + public String getLabelBind() { + return labelBind; + } + + public void setLabelBind(String labelBind) { + this.labelBind = labelBind; + } + + public String getMajorCategory() { + return majorCategory; + } + + public void setMajorCategory(String majorCategory) { + this.majorCategory = majorCategory; + } + + public String getMajorCategoryName() { + return majorCategoryName; + } + + public void setMajorCategoryName(String majorCategoryName) { + this.majorCategoryName = majorCategoryName; + } + + public String getManagerLevel() { + return managerLevel; + } + + public void setManagerLevel(String managerLevel) { + this.managerLevel = managerLevel; + } + + public String getManagerLevelName() { + return managerLevelName; + } + + public void setManagerLevelName(String managerLevelName) { + this.managerLevelName = managerLevelName; + } + + public String getManagerState() { + return managerState; + } + + public void setManagerState(String managerState) { + this.managerState = managerState; + } + + public String getManagerStateName() { + return managerStateName; + } + + public void setManagerStateName(String managerStateName) { + this.managerStateName = managerStateName; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getManufacturerCountry() { + return manufacturerCountry; + } + + public void setManufacturerCountry(String manufacturerCountry) { + this.manufacturerCountry = manufacturerCountry; + } + + public String getManufacturingDate() { + return manufacturingDate; + } + + public void setManufacturingDate(String manufacturingDate) { + this.manufacturingDate = manufacturingDate; + } + + public String getManufacturingNo() { + return manufacturingNo; + } + + public void setManufacturingNo(String manufacturingNo) { + this.manufacturingNo = manufacturingNo; + } + + public String getMesureCycle() { + return mesureCycle; + } + + public void setMesureCycle(String mesureCycle) { + this.mesureCycle = mesureCycle; + } + + public String getMesureDate() { + return mesureDate; + } + + public void setMesureDate(String mesureDate) { + this.mesureDate = mesureDate; + } + + public String getMesureDept() { + return mesureDept; + } + + public void setMesureDept(String mesureDept) { + this.mesureDept = mesureDept; + } + + public String getMesureDeptName() { + return mesureDeptName; + } + + public void setMesureDeptName(String mesureDeptName) { + this.mesureDeptName = mesureDeptName; + } + + public String getMesureRange() { + return mesureRange; + } + + public void setMesureRange(String mesureRange) { + this.mesureRange = mesureRange; + } + + public String getMesureResult() { + return mesureResult; + } + + public void setMesureResult(String mesureResult) { + this.mesureResult = mesureResult; + } + + public String getMesureResultName() { + return mesureResultName; + } + + public void setMesureResultName(String mesureResultName) { + this.mesureResultName = mesureResultName; + } + + public String getMesureType() { + return mesureType; + } + + public void setMesureType(String mesureType) { + this.mesureType = mesureType; + } + + public String getMesureTypeName() { + return mesureTypeName; + } + + public void setMesureTypeName(String mesureTypeName) { + this.mesureTypeName = mesureTypeName; + } + + public String getModelNo() { + return modelNo; + } + + public void setModelNo(String modelNo) { + this.modelNo = modelNo; + } + + public String getOriginValue() { + return originValue; + } + + public void setOriginValue(String originValue) { + this.originValue = originValue; + } + + public String getOverallDimension() { + return overallDimension; + } + + public void setOverallDimension(String overallDimension) { + this.overallDimension = overallDimension; + } + + public String getPresentOriginValue() { + return presentOriginValue; + } + + public void setPresentOriginValue(String presentOriginValue) { + this.presentOriginValue = presentOriginValue; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getSinglePrice() { + return singlePrice; + } + + public void setSinglePrice(String singlePrice) { + this.singlePrice = singlePrice; + } + + public String getSupportStandardEquipmentName() { + return supportStandardEquipmentName; + } + + public void setSupportStandardEquipmentName(String supportStandardEquipmentName) { + this.supportStandardEquipmentName = supportStandardEquipmentName; + } + + public String getSupportStandardEquipmentNo() { + return supportStandardEquipmentNo; + } + + public void setSupportStandardEquipmentNo(String supportStandardEquipmentNo) { + this.supportStandardEquipmentNo = supportStandardEquipmentNo; + } + + public String getTechnicalLevel() { + return technicalLevel; + } + + public void setTechnicalLevel(String technicalLevel) { + this.technicalLevel = technicalLevel; + } + + public String getUncertainty() { + return uncertainty; + } + + public void setUncertainty(String uncertainty) { + this.uncertainty = uncertainty; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getUseDept() { + return useDept; + } + + public void setUseDept(String useDept) { + this.useDept = useDept; + } + + public String getUseDeptName() { + return useDeptName; + } + + public void setUseDeptName(String useDeptName) { + this.useDeptName = useDeptName; + } + + public String getUsePerson() { + return usePerson; + } + + public void setUsePerson(String usePerson) { + this.usePerson = usePerson; + } + + public String getUsePersonName() { + return usePersonName; + } + + public void setUsePersonName(String usePersonName) { + this.usePersonName = usePersonName; + } + + public String getValidDate() { + return validDate; + } + + public void setValidDate(String validDate) { + this.validDate = validDate; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getWeight() { + return weight; + } + + public void setWeight(String weight) { + this.weight = weight; + } + } + } +} diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt index c4eb16d..cb371ab 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitService.kt @@ -282,6 +282,26 @@ suspend fun getRemindEquipmentCount(@Header("token") token: String): String /** + * 获取到期设备列表 + */ + @POST("/meter/assets/remindListPage") + suspend fun getRemindEquipmentList( + @Header("token") token: String, + @Body requestBody: RequestBody, + @QueryMap limit: Map, + @QueryMap offset: Map + ): String + + /** + * 催办设备 + */ + @POST("/meter/assets/remindWorker") + suspend fun remindEquipment( + @Header("token") token: String, + @Body requestBody: RequestBody + ): String + + /** * 获取到期仪器数 */ @GET("/meter/standard/remindQuantity") diff --git a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt index 8b385fa..613e881 100644 --- a/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt +++ b/app/src/main/java/com/casic/xz/meterage/utils/retrofit/RetrofitServiceManager.kt @@ -317,7 +317,6 @@ offset: Int ): String { val param = JsonObject() - param.addProperty("sid", "username") param.addProperty("equipmentNo", equipmentNo) param.addProperty("equipmentName", equipmentName) param.addProperty("mesureType", mesureType) @@ -606,6 +605,84 @@ } /** + * 获取到期设备列表 + */ + suspend fun getRemindEquipmentList( + managerState: String, + abc: String, + mesureType: String, + isCalibrationTestEquipment: String, + equipmentCategory: String, + useDept: String, + equipmentNo: String, + modelNo: String, + assetNo: String, + assetType: String, + isFixedAssets: String, + equipmentSpecifications: String, + labelId: String, + usePerson: String, + ids: Array, + equipmentName: String, + id: String, + validDateStart: String, + isStandardSupportEquipment: String, + isMeasureAccount: String, + manufacturingNo: String, + validDateEnd: String, + offset: Int + ): String { + val param = JsonObject() + param.addProperty("managerState", managerState) + param.addProperty("abc", abc) + param.addProperty("mesureType", mesureType) + param.addProperty("isCalibrationTestEquipment", isCalibrationTestEquipment) + param.addProperty("equipmentCategory", equipmentCategory) + param.addProperty("useDept", useDept) + param.addProperty("equipmentNo", equipmentNo) + param.addProperty("modelNo", modelNo) + param.addProperty("assetNo", assetNo) + param.addProperty("assetType", assetType) + param.addProperty("isFixedAssets", isFixedAssets) + param.addProperty("equipmentSpecifications", equipmentSpecifications) + param.addProperty("labelId", labelId) + param.addProperty("usePerson", usePerson) + param.add("ids", gson.toJsonTree(ids, typeToken).asJsonArray) + param.addProperty("equipmentName", equipmentName) + param.addProperty("id", id) + param.addProperty("validDateStart", validDateStart) + param.addProperty("isStandardSupportEquipment", isStandardSupportEquipment) + param.addProperty("isMeasureAccount", isMeasureAccount) + param.addProperty("manufacturingNo", manufacturingNo) + param.addProperty("validDateEnd", validDateEnd) + + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + + val limitMap = HashMap() + limitMap["limit"] = LocaleConstant.PAGE_LIMIT + + val offsetMap = HashMap() + offsetMap["offset"] = offset + return api.getRemindEquipmentList( + AuthenticationHelper.token!!, requestBody, limitMap, offsetMap + ) + } + + /** + * 催办设备 + */ + suspend fun remindEquipment(id: String): String { + val param = JsonObject() + param.addProperty("id", id) + val requestBody = param.toString().toRequestBody( + "application/json;charset=UTF-8".toMediaType() + ) + return api.remindEquipment(AuthenticationHelper.token!!, requestBody) + } + + /** * 获取到期仪器数 */ suspend fun getRemindDeviceCount(): String { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt index 9fa4040..2d0126a 100644 --- a/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt +++ b/app/src/main/java/com/casic/xz/meterage/view/home/BusinessStatisticsActivity.kt @@ -130,12 +130,14 @@ override fun initEvent() { leftBackView.setOnClickListener { finish() } + //设备 equipOvertimeLayout.setOnClickListener { - + navigatePageTo() } + //装置 deviceOvertimeLayout.setOnClickListener { - + navigatePageTo() } workTimeLayout.setOnClickListener { diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt new file mode 100644 index 0000000..35a5837 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeDeviceActivity.kt @@ -0,0 +1,4 @@ +package com.casic.xz.meterage.view.home + +class OvertimeDeviceActivity { +} \ No newline at end of file diff --git a/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt new file mode 100644 index 0000000..717e6b2 --- /dev/null +++ b/app/src/main/java/com/casic/xz/meterage/view/home/OvertimeEquipActivity.kt @@ -0,0 +1,264 @@ +package com.casic.xz.meterage.view.home + +import android.content.Context +import android.os.Handler +import androidx.lifecycle.ViewModelProvider +import androidx.recyclerview.widget.DividerItemDecoration +import com.casic.xz.meterage.R +import com.casic.xz.meterage.base.ApplicationBaseActivity +import com.casic.xz.meterage.extensions.formatToYearMonthDay +import com.casic.xz.meterage.extensions.initLayoutImmersionBar +import com.casic.xz.meterage.extensions.isEarlierThenCurrent +import com.casic.xz.meterage.extensions.showEmptyPage +import com.casic.xz.meterage.model.RemindEquipmentListModel +import com.casic.xz.meterage.utils.LoadingDialogHub +import com.casic.xz.meterage.vm.EquipmentViewModel +import com.gyf.immersionbar.ImmersionBar +import com.pengxh.kt.lite.adapter.NormalRecyclerAdapter +import com.pengxh.kt.lite.adapter.ViewHolder +import com.pengxh.kt.lite.extensions.convertColor +import com.pengxh.kt.lite.extensions.navigatePageTo +import com.pengxh.kt.lite.extensions.show +import com.pengxh.kt.lite.utils.WeakReferenceHandler +import com.pengxh.kt.lite.vm.LoadState +import com.pengxh.kt.lite.widget.dialog.AlertControlDialog +import kotlinx.android.synthetic.main.activity_overtime_equip.* +import kotlinx.android.synthetic.main.include_empty_view.* +import kotlinx.android.synthetic.main.include_search_title.* + +class OvertimeEquipActivity : ApplicationBaseActivity() { + + private var context: Context = this@OvertimeEquipActivity + private lateinit var weakReferenceHandler: WeakReferenceHandler + private lateinit var equipmentViewModel: EquipmentViewModel + private lateinit var equipmentAdapter: NormalRecyclerAdapter + private var dataBeans: MutableList = ArrayList() + private var pageIndex = 1 + private var isRefresh = false + private var isLoadMore = false + private var clickedPosition = 0 + + override fun initLayoutView(): Int = R.layout.activity_overtime_equip + + override fun setupTopBarLayout() { + ImmersionBar.with(this).statusBarDarkFont(true).init() + initLayoutImmersionBar(rootView) + titleView.text = "设备到期列表" + } + + override fun initData() { + weakReferenceHandler = WeakReferenceHandler(callback) + equipmentViewModel = ViewModelProvider(this)[EquipmentViewModel::class.java] + equipmentViewModel.remindEquipmentList.observe(this) { + if (it.code == 200) { + val dataRows = it.data?.rows!! + when { + isRefresh -> { + dataBeans.clear() + dataBeans = dataRows + equipmentLayout.finishRefresh() + isRefresh = false + } + isLoadMore -> { + if (dataRows.size == 0) { + "到底了,别拉了".show(this) + } + dataBeans.addAll(dataRows) + equipmentLayout.finishLoadMore() + isLoadMore = false + } + else -> { + dataBeans = dataRows + } + } + weakReferenceHandler.sendEmptyMessage(2023041801) + } + } + + equipmentViewModel.remindEquipmentResult.observe(this) { + if (it.code == 200) { + //催办之后列表虽然刷新,但是列表依旧存在,只有在对方处理了过期设备,列表还是刷新 + "操作成功".show(this) + } + } + } + + override fun observeRequestState() { + equipmentViewModel.loadState.observe(this) { + when (it) { + LoadState.Loading -> LoadingDialogHub.show(this, "数据加载中...") + else -> LoadingDialogHub.dismiss() + } + } + } + + override fun initEvent() { + leftBackView.setOnClickListener { finish() } + + equipmentLayout.setOnRefreshListener { + isRefresh = true + //刷新之后页码重置 + pageIndex = 1 + getRemindEquipmentListByPage() + } + + equipmentLayout.setOnLoadMoreListener { + isLoadMore = true + pageIndex++ + getRemindEquipmentListByPage() + } + } + + override fun onResume() { + super.onResume() + pageIndex = 1 + getRemindEquipmentListByPage() + } + + private fun getRemindEquipmentListByPage() { + equipmentViewModel.getRemindEquipmentList( + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + arrayOf(), + "", + "", + "", + "", + "", + "", + "", + pageIndex + ) + } + + private val callback = Handler.Callback { + when (it.what) { + 2023041801 -> { + if (isRefresh || isLoadMore) { + equipmentAdapter.notifyDataSetChanged() + } else { + if (dataBeans.size == 0) { + emptyView!!.showEmptyPage("无过期设备") { + pageIndex = 1 + getRemindEquipmentListByPage() + } + } else { + emptyView!!.hide() + equipmentAdapter = object : + NormalRecyclerAdapter( + R.layout.item_remind_equipment_rv_l, dataBeans + ) { + override fun convertView( + viewHolder: ViewHolder, + position: Int, + item: RemindEquipmentListModel.DataModel.RowsModel + ) { + val modelNo = if (item.modelNo.isNullOrBlank()) { + "未知" + } else { + item.modelNo + } + + val remark = if (item.remark.isNullOrBlank()) { + "无" + } else { + item.remark + } + + val useDept = if (item.useDeptName.isNullOrBlank()) { + "未知" + } else { + item.useDeptName + } + + val usePerson = if (item.usePersonName.isNullOrBlank()) { + "无" + } else { + item.usePersonName + } + + if (item.validDate.isEarlierThenCurrent()) { + viewHolder.setTextColor( + R.id.deviceDateView, R.color.red.convertColor(context) + ) + } else { + viewHolder.setTextColor( + R.id.deviceDateView, R.color.gray.convertColor(context) + ) + } + + viewHolder.setText(R.id.equipmentName, item.equipmentName) + .setText(R.id.modelView, modelNo) + .setText(R.id.equipmentStateView, item.managerStateName) + .setText(R.id.equipmentCodeView, "装置编号:${item.equipmentNo}") + .setText(R.id.remarkView, "备注:$remark") + .setText(R.id.useDeptView, useDept) + .setText( + R.id.deviceDateView, + "有效期至:${item.validDate.formatToYearMonthDay()}" + ) + .setText(R.id.usePersonView, "管理员:$usePerson") + + if (!item.managerStateName.contains("在用")) { + viewHolder.setBackgroundColor( + R.id.equipmentStateView, R.color.gray.convertColor(context) + ) + } + + viewHolder.setOnClickListener(R.id.remindButton) { + //标记被点击的item位置 + clickedPosition = position + AlertControlDialog.Builder() + .setContext(context) + .setTitle("提示") + .setMessage("确定催办该设备?") + .setNegativeButton("取消") + .setPositiveButton("确定") + .setOnDialogButtonClickListener(object : + AlertControlDialog.OnDialogButtonClickListener { + override fun onCancelClick() { + + } + + override fun onConfirmClick() { + if (item.id.isBlank()) { + "设备ID异常,无法催办".show(context) + return + } + equipmentViewModel.remindEquipment(item.id) + } + }).build().show() + } + } + } + equipmentRecyclerView.addItemDecoration( + DividerItemDecoration(this, DividerItemDecoration.VERTICAL) + ) + equipmentRecyclerView.adapter = equipmentAdapter + equipmentAdapter.setOnItemClickedListener(object : + NormalRecyclerAdapter.OnItemClickedListener { + override fun onItemClicked( + position: Int, t: RemindEquipmentListModel.DataModel.RowsModel + ) { + navigatePageTo(t.id) + } + }) + } + } + } + } + true + } +} \ No newline at end of file diff --git a/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt b/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt index 076ac4c..b1817bc 100644 --- a/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt +++ b/app/src/main/java/com/casic/xz/meterage/vm/EquipmentViewModel.kt @@ -28,6 +28,8 @@ val stateChangeResult = MutableLiveData() val usageRecordResult = MutableLiveData() val remindEquipmentCount = MutableLiveData() + val remindEquipmentList = MutableLiveData() + val remindEquipmentResult = MutableLiveData() val remindDeviceCount = MutableLiveData() fun getEquipmentList( @@ -230,6 +232,88 @@ it.printStackTrace() }) + fun getRemindEquipmentList( + managerState: String, + abc: String, + mesureType: String, + isCalibrationTestEquipment: String, + equipmentCategory: String, + useDept: String, + equipmentNo: String, + modelNo: String, + assetNo: String, + assetType: String, + isFixedAssets: String, + equipmentSpecifications: String, + labelId: String, + usePerson: String, + ids: Array, + equipmentName: String, + id: String, + validDateStart: String, + isStandardSupportEquipment: String, + isMeasureAccount: String, + manufacturingNo: String, + validDateEnd: String, + offset: Int + ) = launch({ + loadState.value = LoadState.Loading + val response = RetrofitServiceManager.getRemindEquipmentList( + managerState, + abc, + mesureType, + isCalibrationTestEquipment, + equipmentCategory, + useDept, + equipmentNo, + modelNo, + assetNo, + assetType, + isFixedAssets, + equipmentSpecifications, + labelId, + usePerson, + ids, + equipmentName, + id, + validDateStart, + isStandardSupportEquipment, + isMeasureAccount, + manufacturingNo, + validDateEnd, + offset + ) + val responseCode = response.separateResponseCode() + if (responseCode == 200) { + loadState.value = LoadState.Success + remindEquipmentList.value = gson.fromJson( + response, object : TypeToken() {}.type + ) + } else { + loadState.value = LoadState.Fail + response.toErrorMessage().show(BaseApplication.get()) + } + }, { + loadState.value = LoadState.Fail + it.cause.toString().show(BaseApplication.get()) + it.printStackTrace() + }) + + fun remindEquipment(id: String) = launch({ + val response = RetrofitServiceManager.remindEquipment(id) + val responseCode = response.separateResponseCode() + if (responseCode == 200) { + remindEquipmentResult.value = gson.fromJson( + response, object : TypeToken() {}.type + ) + } else { + response.toErrorMessage().show(BaseApplication.get()) + } + }, { + it.cause.toString().show(BaseApplication.get()) + it.printStackTrace() + }) + fun getRemindDeviceCount() = launch({ val response = RetrofitServiceManager.getRemindDeviceCount() val responseCode = response.separateResponseCode() diff --git a/app/src/main/res/layout/activity_overtime_equip.xml b/app/src/main/res/layout/activity_overtime_equip.xml new file mode 100644 index 0000000..c8dc9b8 --- /dev/null +++ b/app/src/main/res/layout/activity_overtime_equip.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_remind_equipment_rv_l.xml b/app/src/main/res/layout/item_remind_equipment_rv_l.xml new file mode 100644 index 0000000..f063784 --- /dev/null +++ b/app/src/main/res/layout/item_remind_equipment_rv_l.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file