Skip to content
Snippets Groups Projects
Commit fd9e1853 authored by wyl's avatar wyl
Browse files

fix bugs

parent b91d3344
No related branches found
No related tags found
1 merge request!61fix bugs
......@@ -206,10 +206,21 @@ public class SuperAdminServiceImp implements SuperAdminService {
List<CommonAdmin> commonAdmins = superAdminMapper.selectPageCommonAdmin(pageSize, pageNumber);
//get all and count items
List<AdminVO> adminVOS = superAdminMapper.selectAllAdmin();
ArrayList<AdminVO> adminVOS1 = new ArrayList<>();
if(commonAdmins.size()>0){
System.out.println(adminVOS.size());
commonAdmins.forEach(commonAdmin -> {
AdminVO adminVO = new AdminVO();
if(commonAdmin.getStatus() == 1) {
BeanUtils.copyProperties(commonAdmin,adminVO);
adminVO.setStatus_str("ACTIVE");
}else {
BeanUtils.copyProperties(commonAdmin,adminVO);
adminVO.setStatus_str("INACTIVE");
}
adminVOS1.add(adminVO);
});
Integer count=adminVOS.size()%pageSize==0?adminVOS.size()/pageSize:adminVOS.size()/pageSize+1;
return Result.success(count.toString(),commonAdmins);
return Result.success(count.toString(),adminVOS1);
}
}
if(type.equals("hospital")){
......
......@@ -3,4 +3,4 @@ healthcare:
url: jdbc:mysql://localhost:3306/health_care
port: 3306
username: root
password: 472500
\ No newline at end of file
password: root
\ No newline at end of file
......@@ -81,7 +81,7 @@
<select required id="type">
<option value="" disabled selected>Select Type</option>
<option style="color: black" value="hospital">hospital</option>
<option style="color: black" value="patient">patient</option>
<option style="color: black" value="Nursing staff">Nursing staff</option>
</select>
</div>
</form>
......@@ -101,8 +101,8 @@
function regist() {
if (type === "hospital") {
role = "HOSPITAL";
} else if (type === "patient") {
role = "PATIENT";
} else if (type === "Nursing staff") {
role = "Nursing staff";
}
const url = '/superAdmin/sign';
......
......@@ -72,14 +72,14 @@ $(document).on("click","#edit",function (){
//Load form
//padding data
document.getElementById("name").value=data.data[0].name
document.getElementById("phone").value=data.data[0].phone
document.getElementById("address").value=data.data[0].address
document.getElementById("email").value=data.data[0].email
document.getElementById("maxAmount").value=data.data[0].maxAmount
document.getElementById("patientAmount").value=data.data[0].amountPatient
document.getElementById("status").value=data.data[0].status
document.getElementById("id").value=data.data[0].id
document.getElementById("name").value=data.data[row.data('id')-1].name
document.getElementById("phone").value=data.data[row.data('id')-1].phone
document.getElementById("address").value=data.data[row.data('id')-1].address
document.getElementById("email").value=data.data[row.data('id')-1].email
document.getElementById("maxAmount").value=data.data[row.data('id')-1].maxAmount
document.getElementById("patientAmount").value=data.data[row.data('id')-1].amountPatient
document.getElementById("status").value=data.data[row.data('id')-1].status
document.getElementById("id").value=data.data[row.data('id')-1].id
//Change css
const overlay = document.getElementById("overlay");
......
......@@ -68,11 +68,11 @@ $(document).on("click", "#edit", function () {
//Load form
//padding data
document.getElementById("name").value = data.data[0].name
document.getElementById("email").value = data.data[0].email
document.getElementById("phone").value = data.data[0].phone
document.getElementById("status").value = data.data[0].status
document.getElementById("id").value = data.data[0].id
document.getElementById("name").value = data.data[row.data('id')-1].name
document.getElementById("email").value = data.data[row.data('id')-1].email
document.getElementById("phone").value = data.data[row.data('id')-1].phone
document.getElementById("status").value = data.data[row.data('id')-1].status
document.getElementById("id").value = data.data[row.data('id')-1].id
//Change css
const overlay = document.getElementById("overlay");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment