人员库-全员重置密码

This commit is contained in:
lSun 2025-08-28 16:44:57 +08:00
parent 9e91f12009
commit 12520642e4
7 changed files with 53 additions and 1 deletions

View File

@ -19,6 +19,7 @@ import com.bonus.boot.manager.manager.utils.GlobalConst;
import com.bonus.boot.manager.task.UnifyTask; import com.bonus.boot.manager.task.UnifyTask;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -216,7 +217,7 @@ public class PersonnelLibraryController {
@LogAnnotation @LogAnnotation
@PostMapping("resetPassword") @PostMapping("resetPassword")
@ApiOperation(value = "体检人员库-删除") @ApiOperation(value = "体检人员库-重置密码")
public AjaxRes resetPassword(PersonnelLibraryBean bean) { public AjaxRes resetPassword(PersonnelLibraryBean bean) {
AjaxRes ar = new AjaxRes(); AjaxRes ar = new AjaxRes();
int result = service.resetPassword(bean); int result = service.resetPassword(bean);
@ -320,4 +321,19 @@ public class PersonnelLibraryController {
return isActive; return isActive;
} }
@LogAnnotation
@PostMapping("resetPasswordAll")
@ApiOperation(value = "体检人员库-重置密码-全员")
@PreAuthorize("hasAuthority('sys:reset:all')")
public AjaxRes resetPasswordAll(PersonnelLibraryBean bean) {
AjaxRes ar = new AjaxRes();
int result = service.resetPasswordAll(bean);
if (result > 0 ) {
ar.setSucceedMsg(GlobalConst.DATA_SUCCEED);
} else {
ar.setFailMsg(GlobalConst.DATA_FAIL);
}
return ar;
}
} }

View File

@ -57,4 +57,6 @@ public interface PersonnelLibraryDao {
int getIdNumber(@Param("idNumber")String idNumber); int getIdNumber(@Param("idNumber")String idNumber);
PersonnelReservationBean getMealNameNew(@Param("setMeal")String setMeal); PersonnelReservationBean getMealNameNew(@Param("setMeal")String setMeal);
int resetPasswordAll(PersonnelLibraryBean bean);
} }

View File

@ -19,4 +19,6 @@ public interface PersonnelLibraryService {
int resetPassword(PersonnelLibraryBean bean); int resetPassword(PersonnelLibraryBean bean);
List<ZNode> getDepartmentTree(); List<ZNode> getDepartmentTree();
int resetPasswordAll(PersonnelLibraryBean bean);
} }

View File

@ -120,4 +120,11 @@ public class PersonnelLibraryServiceImpl implements PersonnelLibraryService {
public List<ZNode> getDepartmentTree() { public List<ZNode> getDepartmentTree() {
return dao.getDepartmentTree(); return dao.getDepartmentTree();
} }
@Override
public int resetPasswordAll(PersonnelLibraryBean bean) {
bean.setPassword(passwordEncoder.encode("YNsbd@123456"));
return dao.resetPasswordAll(bean);
}
} }

View File

@ -218,5 +218,11 @@
base_name_id = #{setMeal} base_name_id = #{setMeal}
where is_active = '1' and id=#{id} where is_active = '1' and id=#{id}
</update> </update>
<update id="resetPasswordAll">
update pm_base_physical
set phy_password = #{password}
where is_active = '1'
</update>
</mapper> </mapper>

View File

@ -316,4 +316,19 @@ function importExcelNew() {
} }
}); });
$("#articleImageFileNew").val(""); $("#articleImageFileNew").val("");
}
/**
* 重置密码
* @param id
*/
function resetPasswordAll(){
layer.confirm('确定要重置密码吗?', {
btn : [ '确定', '取消' ]
}, function() {
ajaxCommonMethods('/personnelLibrary/resetPasswordAll',{},"重置成功","重置失败","1");
layer.close(1);
});
} }

View File

@ -157,5 +157,9 @@
<button id="importExcelNew" style="margin-bottom: 3px" onclick="importExcelNew()" class="layui-btn layui-btn-sm" ><i class="layui-icon">&#xe601;</i>导入预约-新</button> <button id="importExcelNew" style="margin-bottom: 3px" onclick="importExcelNew()" class="layui-btn layui-btn-sm" ><i class="layui-icon">&#xe601;</i>导入预约-新</button>
</div> </div>
<div class="layui-inline">
<button class="layui-btn layui-btn-sm" onclick="resetPasswordAll()" permission="sys:reset:all" ><i class="layui-icon">&#xe67d;</i>全员重置密码</button>
</div>
</div> </div>
</script> </script>